hey folks,
I have a session variable called loggedon. I set it to 1 when the user is logged on and 0 when they are logged off.
I do a swtich statement as seen below. but it isn't working as it should.
$state = $_SESSION['loggedon'];
switch ($state)
{
case 0:
include("../includes/login.php");
break;
case 1:
echo "logged in";
echo "<br /><a href='../logoff.php'>Log off</a>";
break;
default:
include("../includes/login.php");
}
Anyone understand why?
Cheers,
Jonesy