Page 1 of 1

gatekeeper script

Posted: Mon Feb 10, 2003 1:09 pm
by CrazyJimmy
Hello,

I have bits of my site that only can be viewed if members have logged in.
I use the following script at the top of each page to make sure they are logged in. The script appears to work fine, just wondered if i am doing it the best way and checking enough.

Code: Select all

<?php
session_start();
IF (!isset($_SESSION['username'])) {
echo "You are not logged in or session has expired";
exit;
}



?>

Posted: Mon Feb 10, 2003 1:11 pm
by BigE
Looks good... you might also want to try empty() in that case. Otherwise everything looks good to me.