Nieuw lid |
|
bij onderstaande code zou er een registratie in mijn database moeten gebeuren. Sinds dat ik de controle van het emailadres heb ingebouwd loopt er iets grandioos mis.
<?php
if ($submit)
{
if ($nickname&&$username&&$password&&$password2&&$email)
{
if($password == $password2)
{
if(strlen($username) > 25 || strlen($nickname) > 25)
{
if(strlen($password) > 25 || strlen($password) < 6)
{
if (strpos($email,"@") === true)
{
$var = explode("@",$email);
if (count($var)==2)
{
if(strpos($var[1],".")=== true)
{
$connection = mysql_connect('localhost', 'root', '') or die ("Could not connect to the database server!");
mysql_select_db("test", $connection) or die ("Could not connect to the database");
$register = sprintf("INSERT INTO users (id,username,password,nickname,date,email,registerIP) VALUES('', '%s', '%s', '%s', '%s','%s','%s')",
mysql_real_escape_string($username),
mysql_real_escape_string($password),
mysql_real_escape_string($nickname),
mysql_real_escape_string($date),
mysql_real_escape_string($email),
mysql_real_escape_string($registerIP));
mysql_query($register);
die("Successfully registered please <a href='index.php'>Log in</a>!");
}
else
echo "No valid emailaddress. . is missing<br/>";
}
else
echo "No valid emailaddress. @ is missing.<br/>";
}
else
echo "Password must be between 6 - 25 characters!";
}
else
echo "Username and Nickname maximum is 25 characters";
}
else
echo "Password does not match!";
}
else
echo "Please fill in all fields!";
}
}
?>
<?php if ($submit) { if ($nickname&&$username&&$password&&$password2&&$email) { if($password == $password2) { { { if (strpos($email,"@") === true) { { if(strpos($var[1],".")=== true) { $connection = mysql_connect('localhost', 'root', '') or die ("Could not connect to the database server!"); $register = sprintf("INSERT INTO users (id,username,password,nickname,date,email,registerIP) VALUES('', '%s', '%s', '%s', '%s','%s','%s')", die("Successfully registered please <a href='index.php'>Log in</a>!"); } else echo "No valid emailaddress. . is missing<br/>"; } else echo "No valid emailaddress. @ is missing.<br/>"; } else echo "Password must be between 6 - 25 characters!"; } else echo "Username and Nickname maximum is 25 characters"; } else echo "Password does not match!"; } else echo "Please fill in all fields!"; } } ?>
|