rendered paste body<?php
$nick = $_POST['n'];
$action = $_POST['a'];
//echo "i made it this far<br />nick: ".$nick."<br />action: ".$action;
if($_POST['n']=="" || strlen($_POST['n'])<=3){
echo "
<div id=\"notice\" style=\"font-weight:bold;\">Nickname must be atleast 4 characters in length.</div>
<hr />
<div id=\"note\">Enter a nickname:</div>
<form method=\"post\" action=\"chat.php\" onsubmit=\"send_nick(this); return false;\">
<input type=\"text\" name=\"n\" size=\"30\" />
<input type=\"submit\" value=\"Continue ->\" name=\"btnSubmit\" />
</form> ";
} else {
echo "
<div id=\"notice\" style=\"font-weight:bold;\">Hello ".$nick.", Welcome to the chat.</div>
<hr />
<div id=\"note\">Type something below.</div>
<form method=\"post\" action=\"\" onsubmit=\"send_data(this); return false;\">
<input type=\"text\" name=\"ctext\" size=\"30\" />
<input type=\"submit\" value=\"Send\" name=\"btnSend\" />
</form>
<br />
<div id=\"container\">
<div id=\"head\"><b>Result:</b> </div>
<div id=\"replace_me\"></div>
</div> ";
}
?>