Question is in the subject
Here's a snippet...
//Check to see if any rows were returned from the $sql query. If so, set SESSION variables//
if(mysql_num_rows($result) == 1)
{
$_SESSION['entered_username'] = $_POST['username'];
$_SESSION['login'] = 'yes';
//header("Location: member.php");
echo "<h2><center>You have been validated. Please wait, logging you in. . .</h2><br>
<center>If your browser doesn't support redirection and you're still here in 3 seconds, <a href='member.php'>click here</a></center>";
}
else
{
echo "<b><u><center>Login failure </b></u><br>Username/Password mismatch. 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>";
}
The code above is from my login.php page. I have commented out the header function which will log the user in without having cookies enabled. if I uncomment it, it fails when the member.php page checks to see if the user has logged on or is trying to jump to the member page without logging 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();
}
It's easy enough for me to set up a check that will check if cookies are enabled but ideally I would like the header function to work regardless.
So, any ideas?