';
}
if(empty($_POST['fname'])){
$fname = 'First Name can't be empty
';
}
if(empty($_POST['lname'])){
$lname = 'Last Name can't be empty
';
}
if(empty($_POST['email'])){
$email = 'Email can't be empty
';
}
if(empty($_POST['password'])){
$password = 'Password can't be empty
';
}
if(empty($_POST['re_password'])){
$re_password = 'You must re-type your password
';
}
if($row){
$user_name_exist = 'User Name already exists
';
}
if($_POST['password']!=$_POST['re_password']){
$password_match = 'Passwords don't match
';
}
}else{
# If all fields are not empty, and the passwords match,
# create a session, and session variables,
# register_accept will be checked on the next page to see
# if the user came from this page.
session_start();
$_SESSION['user_name'] = $_POST['user_name'];
$_SESSION['fname'] = $_POST['fname'];
$_SESSION['lname'] = $_POST['lname'];
$_SESSION['email'] = $_POST['email'];
$_SESSION['password'] = $_POST['password'];
$_SESSION['register_accept'] = 1;
header("Location: confirm_join.php");
exit;
}
}
# echo out each variable that was set from above,
# then destroy the variable.
if(isset($user)){
echo $user;
unset($user);
}
if(isset($fname)){
echo $fname;
unset($fname);
}
if(isset($lname)){
echo $lname;
unset($lname);
}
if(isset($email)){
echo $email;
unset($email);
}
if(isset($password)){
echo $password;
unset($password);
}
if(isset($re_password)){
echo $re_password;
unset($re_password);
}
if(isset($user_name_exist)){
echo $user_name_exist;
unset($user_name_exist);
}
if(isset($password_match)){
echo $password_match;
unset($password_match);
}
?>