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";
<html>
<head>
<title>RPG</title>
</head>

<body>
<?php
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);
	mysql_select_db("$DBName");
	
	
	$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.";
	}
}
if($task=="log"){
	$LogUser = strtoupper ($LogUser);
	$LogPass = strtoupper ($LogPass);
	
	$LogUser = ereg_replace("[^A-Za-z0-9 ]", "", $LogUser); 
	$LogPass = ereg_replace("[^A-Za-z0-9 ]", "", $LogPass);
	
	mysql_connect($DBhost,$DBuser,$DBpass);
	mysql_select_db("$DBName");
	
	$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"; 
	}
}
if($task=="update"){
	
}
if($task=="chat"){
	
}
?>
<table width="730" height="475" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
	<td width="720" height="465"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,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="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="720" height="465"></embed> 
	  </object></td>
	<td width="10">&nbsp;</td>
  </tr>
  <tr> 
	<td height="10" colspan="2">&nbsp;</td>
  </tr>
</table>
</body>
</html>