<?PHP
if (strlen(trim($first_name))==0) { $err0=true; } else { $n0=true; }
if (strlen(trim($last_name))==0) { $err1=true; } else { $n1=true; }
if (strlen(trim($email))==0) { $err2=true; } else { $n2=true; }
if (check_email($email)==1) {$err3=true;} else {$n3=true;}
if (strlen(trim($username))==0) { $err4=true; } else { $n4=true; }
if (check_user($username)==1) {$err5=true;} else {$n5=true;}
if (strcmp($password, $password1)!=0||strlen(trim($password))==0) {$err6=true;} else {$n6=true;}

if (isset($n0)&&isset($n2)&&isset($n3)&&isset($n4)&&isset($n5)&&isset($n6))
	{
	if (isset($xx))
		{
		mysql_query("insert into user set first_name='".addslashes(trim($first_name))."', last_name='".addslashes(trim($last_name))."', email='".addslashes(trim($email))."', username='".addslashes(trim($username))."', password='".md5(strtolower(trim($password)))."', sid='".create_sid()."', status='69'");

		$done=true;
		}
	else
		{
		$sid=create_sid();

		mysql_query("insert into user set first_name='".addslashes(trim($first_name))."', last_name='".addslashes(trim($last_name))."', email='".addslashes(trim($email))."', username='".addslashes(trim($username))."', password='".md5(strtolower(trim($password)))."', sid='".addslashes(trim($sid))."', status='69'");

		header("Location: ".$http_admin."/index.php?sid=".trim($sid)."");
		exit;
		}
	}
?>