Login formel <--- Er dette korrekt.
Hej eksperter... Jeg har lavet et login formel, men min site melder fejl. Hvor går det galt?- - - - - - - - - - - - - - - - - - - - - - - - -
<html>
<head>
<title>Joining 1vs1</title>
</head>
<body>
<form method="POST" action="<? echo $PHP_SELF; ?>">
<table border="0" width="35%">
<tr>
<td>Full Name</td>
<td><input type="text" name="name" size="20" value="<? echo $name; ?>"></td>
</tr>
<tr>
<td>Player Alias</td>
<td><input type="text" name="nick" size="20" value="<? echo $nick; ?>"></td>
</tr>
<tr>
<td>E-mail</td>
<td><input type="text" name="email" size="20" value="<? echo $email; ?>"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="text" name="pass" size="20"></td>
</tr>
<tr>
<td>Re-enter Password</td>
<td><input type="text" name="repass" size="20"></td>
</tr>
<tr>
<td>Clan</td>
<td><input type="text" name="clan" size="20" value="<? echo $clan; ?>"></td>
</tr>
<tr>
<td>Before joining 1vs1, you have to agree to some rules and terms made by
1vs1. This will ensure that we can make the pleasure good for everybody. Click here for
terms and rules.</td>
<td><input type="checkbox" name="ok" value="OFF"></td>
</tr>
</table>
<input type="submit" value="submit" name="submit">
<?
if($submit)
{
if($pass != $repass)
{
echo "Passwords do not match";
}
else if(!$ok)
{
echo "You have not agreed to the terms and rules. You must do so to join 1vs1";
}
else if(!$name)
{
echo "You must write your name";
}
else if(!$nick)
{
echo "You must choose a player Alias";
}
else if(!$email)
{
echo "You must have an email adress. If you dont have a email, you can get one for free at <a href=\"www.hotmail.com</a>";" target="_blank">http://www.hotmail.com\">www.hotmail.com</a>";
}
else
{
$db = mysql_connect("localhost","username","password");
mysql_select_db("members", $db);
$result = mysql_query("SELECT username FROM users WHERE username='$user'");
$data = mysql_fetch_array($result);
if($data['username'] == $user)
{
echo "Sorry, that username already exists";
}
else
{
$pass = md5($pass);
mysql_query("INSERT INTO members (name, nick, email, pass, clan) VALUES('$name','$nick','$email','$pass','$clan')");
echo "Congratulations you are now a member of 1 vs 1";
}
}
}
?>
</form>
</body>
</html>
- - - - - - - - - - - - - - - - - - - - - - - - -
Fejlen ligger i linie 66. Hjælp mig
Evilfish
