I have a login and validation page before someone can get into a simple web application I am writing.
Is there anything that I can include on each script page that requires them to have logged in before accessing it?
Does anyone have the best idea?
Chris
Security on each page
Moderator: General Moderators
- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm
You can include a script.
Code: Select all
include('checkLogin.php');More to the point, after a successfull login, set a SESSION variable to indicate who has just logged on.
then, as suggested, include a php file that has in it (among other things):
then, as suggested, include a php file that has in it (among other things):
Code: Select all
<?PHP
session_start();
.
.
if (!isset($_SESSION['userid']))
{
// not logged in so go handle
}
else
{
// user is logged in so do the other stuff
}
?>