Hey, I'm going bonkers with this one. Below I am creating a session named 'accesslogin' once the user successfully logs in.
This is the latter part of the code...
if (($variable2 != $loginname) OR ($variable3 != $passwd))
{
echo "<font size=4 color='fffff'><br>Login Failed. <br><br></font>";
echo "<font size=2>Please check with your Account<br> Manager for the Account password. <br><br></font>";
echo "<font size=2>Use your BACK button to try again. <br><br></font>";
exit;
}
else
{
session_start();
session_register('accesslogin');
echo "<meta http-equiv='refresh' content='0; url=$variable4'>";
I want all pages to redirect to the login page if a user has not successfully logged to prevent boomarking etc.
This code is at the top of my pages but I can still acess them without logging in. I think I need an else statement. As you can see im a bit rough on the code...
<?// includes
// session check
session_start();
if (!session_is_registered("accesslogin")
{
header("Location: login.php?ec=2"
exit;
}
?>
This is the latter part of the code...
if (($variable2 != $loginname) OR ($variable3 != $passwd))
{
echo "<font size=4 color='fffff'><br>Login Failed. <br><br></font>";
echo "<font size=2>Please check with your Account<br> Manager for the Account password. <br><br></font>";
echo "<font size=2>Use your BACK button to try again. <br><br></font>";
exit;
}
else
{
session_start();
session_register('accesslogin');
echo "<meta http-equiv='refresh' content='0; url=$variable4'>";
I want all pages to redirect to the login page if a user has not successfully logged to prevent boomarking etc.
This code is at the top of my pages but I can still acess them without logging in. I think I need an else statement. As you can see im a bit rough on the code...
<?// includes
// session check
session_start();
if (!session_is_registered("accesslogin")
{
header("Location: login.php?ec=2"
exit;
}
?>