Here is the code please have a look at it for me and see if you can find my errors i am a newbie to coding first time actually making a registration code.
i keep getting the same error over and over and won’t submit to database also: This is the error:[COLOR=”Red”]You must enter a valid email address to register.
<?php
ini_set(‘display_errors’,1);
error_reporting(E_ALL);
session_start();
include(“connect.php”);
if(isset($_POST[‘submit’])){
//get all posted data
$username = $_POST[‘user’];
$password = $
$confirmpassword = $_POST[‘confirmpassword’];
$email = $
if($username && $password && $confirmpassword && $email)
{
if((strlen($username)<=6) || (strlen($password)<=6))
{
echo “The username or password is too short!”;
}
else
{
if ($password === $confirmpassword)
{
$sql = mysql_query(“SELECT * FROM users WHERE username=’$username'”);
$numrows = mysql_num_rows($sql) or die(mysql_error());
if ($numrows == 0)
{
echo “The username ‘$username’ already exists!”;
}
else
{
$md5password =md5($password);
mysql_query(“INSER INTO users (id, username, $md5password, email) VALUES
(”,’$username’,’$confirmpassword’)”);
echo “Registration Successful! <a href=’login.php’>Click here to login now!</a>”;
}
}
else
{
echo “Passwords do not match enter both fields!!”;
}
}
}
else
{
die(“Please enter all the required fields!!”);
}
}
?>