Thanks guys. This is the end of the code as to post it all would take up too much space. Basically, the code, checks required fields and input to make sure it's valid and then if all checks pass, the user is entered into the database using the else statement at the end.
$result_email_exists = mysql_query($email_exists) OR die(mysql_error());
//
if(mysql_num_rows($result_email_exists) == 1)
{
echo "<H2><center>Someone has already regisered with that e-mail address. Please use your browser's BACK button and select an alternative one.</H2></center>";
exit();
}
//Otherwise, run the $sql query and update the member table//
else
{
$_SESSION['entered_username'] = $_POST['username'];
$_SESSION['login'] = 'yes';
mysql_query($insert_member) OR die(mysql_error());
header("Location: member.php");
echo "<b><u><center>Your account has been created! </b></u><br>Sit tight, we're sending you back to the login page in 5 seconds.<br>
If your browser doesn't support redirection and you're still here in 5 seconds, <a href='index.php'>click here</a></center>";
}
?>
Now, the code on the member.php page contains an if statement that simply checks that the user has logged on using the following:
if (@$_SESSION['login'] != 'yes')
{
echo "<b><u><center>You haven't logged on!</b></u><p>
<a href='index.php'>Click Here</a> to return to the login page";
exit();
}
$_SESSION['login'] is set to yes after an existing user has logged on or as above, a new user registers but what happens is that I get the message that I have not logged on when being forwarded to the member.php page after creating a new account.
It works fine if I don't use a forwarder. Very confused 😕 .
On another note, I need a memory jog. Whats the syntax to make the redirect wait for x seconds?
Thanks for your help.