<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Refresh" content="5;url=welcome.php" />
</head>
<body>

<?php
$user = $_POST["user"];
$pass = $_POST["pass"];
$confirm = $_POST["confirm"];
$email = $_POST["mail"];

if(($user == NULL)||($pass == NULL)||($confirm == NULL)||($email == NULL))
{
    echo "one or more form is empty<br />";
}
elseif($pass != $confirm)
{
    echo "password dont match with confirmation<br />";
}
elseif(!strchr($email,'@'))
{
    echo "you written something in email feild that is not like a email address<br />";
}
else
{
require('conf.php');

    if(mysql_fetch_array(mysql_query("SELECT * FROM users WHERE user = '" . $user . "'")))
    {
        echo "user exist, choose another one<br />";
    }
    else
    {
        mysql_query("INSERT INTO users (user, password, email)VALUES ('" . $user . "', '" . $pass . "', '" . $email . "')");
        echo "success<br />";
        echo "acount created successfully, return to main screen then login with your brand new username and password!";
    }
}
?>
you will be redirected in 5 second<br />
<a href='welcome.php'>impatient?</a><br />
<?php
mysql_close($sql);
?>

</body>
</html>
