the problem is:
even if there is an error like the passwords dont match, the mysql still creates the user in the database...
<?PHP
if($HTTP_POST_VARS['submit']) {
if (mysql_connect("localhost","root","pass")
or die ("<div align=center><span class=text>Unable to connect to the database. Try again later.</span></div>")) {
mysql_select_db('root');
}
else
print "Couldn't connect!";
if (!$username || !$userpass || !$confirmp || !$useremail)
{
echo '<div align=center><span class=text>You have not entered all the fields. Please go back and fix the missing fields.</span></div>';
exit;
}
Else if ($userpass != $confirmp)
{
echo '<div align=center><span class=text>Your passwords do not match</span></div>';
exit;
}
mysql_query("INSERT INTO users (user_name, user_pass, user_email, user_aimaol, user_msn, user_icq) VALUES ( '$username', '$userpass', '$useremail', '$useraimaol', '$usermsn', '$usericq' ) ")
or die ("<div align=center><span class=text>Unable to create user. Try again later.</span></div>");
} //end if
?>
if anyone knows anything that could help me and add some more stuff to this script, tell!