PHP gevorderde |
|
Ik heb een registreer script geschreven, alleen wil ik dat als er al iemand is met de username/email, de code word afgebroken. Bij mij gaat ie gewoon door, dus geeft ie een echo dat de username als is gebruikt EN dat hij geregistreerd is en kan inloggen.
Iemand enig idee?
<?
if ($checkemail>0) {
echo "<b><font face='verdana' size='-7' color='white'>That email address has already been used! <br>";
}if ($checkname>0) {
echo "<b><font face='verdana' size='-7' color='white'>That username has already been taken!";
}else{
$username = htmlspecialchars($username);
$password = htmlspecialchars($password);
$email = htmlspecialchars($email);
$query = mysql_query("INSERT INTO `users` (username, password, email) VALUES('$username','$password','$email')");
echo "<b><font face='verdana' size='-7' color='white'>You have successfully registered! <br>";
echo "<b><font face='verdana' size='-7' color='white'>You can now login by clicking <a href='index.php'>here</a>";
}
}
}
?>
[code]
<? if ($checkemail>0) { echo "<b><font face='verdana' size='-7' color='white'>That email address has already been used! <br>"; }if ($checkname>0) { echo "<b><font face='verdana' size='-7' color='white'>That username has already been taken!"; }else{ $query = mysql_query("INSERT INTO `users` (username, password, email) VALUES('$username','$password','$email')"); echo "<b><font face='verdana' size='-7' color='white'>You have successfully registered! <br>"; echo "<b><font face='verdana' size='-7' color='white'>You can now login by clicking <a href='index.php'>here</a>"; } } } ?> [code]
- Tags!
[/code]
|