Can you please tell me where i am going wrong i am trying to insert just the username and stuff into my database and its not showing up please help me ASAP! it is connecting to the server okay its just that for some reason its not showing up in the DB!
<?php
echo "<h1>Register</h1>";
$submit = $_POST["submit"];
$usernamenew = strip_tags($_POST["usernamenew"]);
$passwordnew = md5(strip_tags($_POST["passwordnew"]));
$repeatpasswordnew = md5(strip_tags($_POST["repeatpasswordnew"]));
$email = $_POST["email"];
$date = date(Y-m-d);
if ($submit)
{
//check for existence
if ($usernamenew&$passwordnew&$repeatpasswordnew&$email)
{
if ($passwordnew == $repeatpasswordnew)
{
// Open database
echo "Success!";
$connect = mysql_connect("localhost","root","");
if (!$connect)
{
die("Could not connect!");
}
else
{
mysql_select_db("users");
$sql = "INSERT INTO `users` (`id`, `username`, `password`, `email`, `date`) VALUES (NULL, \'$usernamenew\', \'$passwordnew\', \'$email\', \'$date\');";
mysql_query("$sql");
}
}
else
{
echo "The passwords you entered do not match!";
}
}
else
{
echo "Please fill in all the blanks!";
}
}
?>
<html>
<form action="register.php" method="POST">
NEW USERNAME:<input type="text" name="usernamenew" maxlength="25" /><br>
NEW PASSWORD:<input type="password" name="passwordnew" maxlength="25" /><br>
REPEAT NEW PASSWORD:<input type="password" name="repeatpasswordnew" maxlength="25" /><br>
EMAIL ADDRESS:<input type="text" name="email" maxlength=64 /><br>
<input type="submit" name="submit" value="Create Account" />
</form>
</html>