This should work, tell me why it doesnt

See whats happening here:
-----------------------------//edit out, still working on it dont need it messing up.
(just type random characters, it does the same thing when whats typed it is incorrect).
//edit even if you see nothing wrong tell me theres nothing wrong from what you see.

print "_root.login.Status=Success Login Complete&_root.checklog=true";

require 'include.php';

if($task == "reg"){
	$RegUser = strtoupper ($RegUser);
	$RegPass = strtoupper ($RegPass);

	$RegUser = ereg_replace("[^A-Za-z0-9 ]", "", $RegUser); 
	$RegPass = ereg_replace("[^A-Za-z0-9 ]", "", $RegPass); 
	// Connects to the Database.
	$Connect = mysql_connect($DBhost, $DBuser, $DBpass);
	$query = "INSERT INTO $table ('logged', 'user', 'pass', 'x', 'y', 'commentply', 'commentprv') VALUES ('false', '$RegUser', '$RegPass', '0', '0', 'Information others can see here.', 'Private comments from Templarian Studios.')";
	$result = mysql_query($query);
	// Gets the number of rows affected by the query as a check.
	$numR = mysql_affected_rows($Connect);
	if ($numR == 0) {
		print "_root.register.Status=Fill in Fields.";
	} else if ($numR == 1) {
		print "_root.register.Status=Now Login.";
	} else if ($numR == -1) {
		print "_root.register.Status=Server Error.";
	} else { 
		print "_root.register.Status=Username Taken.";
	$LogUser = strtoupper ($LogUser);
	$LogPass = strtoupper ($LogPass);
	$LogUser = ereg_replace("[^A-Za-z0-9 ]", "", $LogUser); 
	$LogPass = ereg_replace("[^A-Za-z0-9 ]", "", $LogPass);
	$query = "SELECT * FROM $table WHERE user = '$LogUser' AND pass = '$LogPass'";
	$result = mysql_query($query);
	$numR = mysql_num_rows($result);
	if ($numR == 1) {
		print "_root.login.Status=Success Login Complete&_root.checklog=true";
	} else {
		print "_root.login.Status=Failure - Your name was not found - Please register&_root.checklog=false"; 
<table width="730" height="475" border="0" align="center" cellpadding="0" cellspacing="0">
	<td width="720" height="465"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,29,0" width="720" height="465">
		<param name="movie" value="rpg.swf">
		<param name=quality value=high>
		<embed src="rpg.swf" quality=high pluginspage="" type="application/x-shockwave-flash" width="720" height="465"></embed> 
	<td width="10">&nbsp;</td>
	<td height="10" colspan="2">&nbsp;</td>