Hi,
I've searched these forums and looked at various tutorials but I can't seem to get the hang of the sessions. This should be so simple but I can't get it working. I have a few pages that are restricted and if you go there it redirects to a login page.
example: (restricted.php)
// if not already logged in then ask them to
if ($_SESSION[login] != "1") {
header("Location: security.php");
} else {
// display page
}
all ok so far...
when a login is authenticated I do this..(security.php)
if ($num != 0 && $activated == "Y") {
$_SESSION[login] = "1";
header("Location: restricted.php");
}
What happens is that I get thrown straight back to security.php
I have
session_start();
on all pages and am running on PHP Version 4.2.3
What am I doing wrong ?
Thanks to anyone who can prevent me putting my foot through my screen.