Forum Moderators: coopster
I have a main.php page .
This page has 3 links on it
laptop.html
cameras.html
dvds.html
This is what I have been trying to achieve ...
without session check:
main.php should open , whether or not user is logged in .
with session check:
When a user clicks on(onclick();) any of the 3 links (laptop.html,cameras.html or dvds.html ) . There should be a Session Check . If user is logged in , fine , display the page .
If user is not logged in , should be redirected to sign in page .
Here's the code that my application is using , however this code was used to check whether a user is signed in or not on main.php .
if(!isset($_SESSION['USERID']) && $_SESSION['USERID']=='')
{
$url=base64_encode( $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
$_SESSION['Message']="Login please";
header("Location:login.php?action=sign_in&path=$url");
exit();
}
?> Thanks .
[edited by: eelixduppy at 9:21 pm (utc) on Jan. 20, 2009]
[edit reason] disabled smileys [/edit]