Dit is me php script:
<?php
error_reporting(E_ALL);
include ("config.php");
include ("head3.php");
if(isset($_POST['submit']))
{
//alles om te laten posten in de db
$username = addslashes($_POST['username']);
$password = md5($_POST['password']);
$hpassword = md5($_POST['hpassword']);
$email = addslashes($_POST['email']);
$active = 0;
if($password == "")
{
exit("Please enter a password");
}
if($hpassword == "")
{
exit("Verify your password");
}
if($username == "")
{
exit("Please enter a username");
}
if($email == "")
{
exit("Please enter a email adres");
}
if($password != $hpassword)
{
exit ("The passwords must match");
}
$resultaat_username = mysql_query("SELECT `user` FROM `players` WHERE `user` = '$username'");
if(mysql_num_rows($resultaat_username) > 0)
{
exit ("Username in use");
}
$aantal_email = mysql_query("SELECT `email` FROM `players` WHERE email = '$email'");
if(mysql_num_rows($aantal_email) > 0)
{
exit ("Emailadres in use");
}
$insert = mysql_query("insert into players (user, pass, email, active) VALUES ('$username', '$password', '$email', '$active')") or die (mysql_error());
$resultaat_id = mysql_query("SELECT `id` FROM `players` WHERE user='$username'");
$id = mysql_result($resultaat_id, 0);
$base = $id;
for($i=0; $i<7; $i++)
{
$base = base64_encode($base);
}
$naar = $email;
$header = "From: TheMafiaGame <[email protected]>\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: text/html;\n";
$header .= "Content-Transfer-Encoding: 7bit";
$onderwerp = "The Mafia Star Account";
$bericht = "Hi New User $user,<br>
<br>
Thanks for signing up at The Mafia Star<br>
";
mail($naar, $onderwerp, $bericht, $header);
echo "You Can Login ! Good Luck !";
}
if(!isset($_POST['submit']))
{
?>
<body><center><table><tr><td>
<form name="form1" method="post" action="register.php">
Username<td>
<input type="text" name="username">
<tr><td>
Password<td>
<input type="password" name="password">
<tr><td>
Password again<td>
<input type="password" name="hpassword">
<tr><td>
Email<td>
<input type="text" name="email">
<tr><td>
<input type="submit" name="submit" value="Register">
</p>
</form>
<p> </p>
</body>
</html>
<?
}
?>
Maar Ik krijg dit:
Notice: Undefined variable: user in /data/members/free/tripod/uk/j/u/l/julkejulke/htdocs/register.php on line 70
wat is er dan fout aan:(
876 views