Well, it is probably simple for most of you. But it is returning errors for me.
Just a heads up, I am creating registration with mySQL database and I am using "email" in place of normal "username" during registration.
Here is code for page after registration has been attempted:
?>
<html>
</head>
<body>
<p>
<? displayStatus(); ?>
</p>
<p> </p>
</body>
</html>
<?
return;
}
/**
* Determines whether or not to show to sign-up form
* based on whether the form has been submitted, if it
* has, check the database for consistency and create
* the new account.
*/
if(isset($_POST['subjoin'])){
/* Make sure all fields were entered */
if(!$_POST['email'] || !$_POST['password'] || !$_POST['fullname'] || !$_POST['birthday'] || !$_POST['birthmonth'] || !$_POST['birthyear'] || !$_POST['gender']){
die('You must completely fill out all fields to register. Please try signing up again.');
}
/* Spruce up username, check length */
$_POST['email'] = trim($_POST['email']);
if(strlen($_POST['email']) > 40){
die("Sorry, the email you provided is longer than 40 characters, please shorten it.");
}
/* Check if username is already in use */
if(mysql_num_rows($email) > 0 ) { //check if there is already an entry for that username
echo "Already taken";
}
if(!$_POST['email']){
die('You did not fill in the email field');
}
/* Add the new account to the database */
$md5pass = md5($_POST['password']);
$_SESSION['reguname'] = $_POST['email'];
$_SESSION['regresult'] = addNewEmail($_POST['email'], $md5pass);
$_SESSION['registered'] = true;
echo "<meta http-equiv=\"Refresh\" content=\"0;url=$HTTP_SERVER_VARS[PHP_SELF]\">";
return;
}
else{
?>