I was following this guys tutorial on how to make a Registration page
and i dont kow why i get this error it wont get sent to MySQL it has something to do with the button could you help me out. the error says
Notice: Undefined index: button in C:\Server\Minecraft\HTML\Registration.php on line 123
<?php
$button = $_POST['button'];
if ($button)
{
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
$retypepassword = $_POST['retypepassword'];
$minecraft_username = $_POST['minecraft_username'];
if ($username && $password && $retypepassword && $email && $minecraft_username)
{
if ($password == $retypepassword)
{
if (strstr($email, "@") && strstr($email, "."))
{
include ("connect.php");
$query = mysql_query ("SELECT * FROM users WHERE username='$username'");
$numrows = mysql_num_rows($query);
if ($numrows == 0)
{
$password = md5($password);
$register = mysql_query ("INSERT INTO users VALUES ('', '$username', '$password, '$email', '$minecraft_username')");
echo "you have been registerd";
}
else
echo "that username is taken";
}
else
echo "Not a valed email";
}
else
echo "passwords dont match";
}
else
echo 'you did not fill in every feild';
}
else
?>
Username: | |
Password: | |
Retype Password: | |
Email: | |
Minecraft Username: | |