Thread: php login
View Single Post
Old 06-05-2008, 08:39   #10 (permalink)
Agricola
Senior Member
 
Agricola's Avatar
 
Join Date: May 2007
Location: England
Posts: 395
Why are you making things more complicated than needed ?

$_SESSION is all you need.

When you check the persons login and password to your database and it matches, simply flag a session variable as having the person logged in.

$_SESSION['user_logged_in']="ooooYESBabyImIn";

then have a check built into the top of every page that is only availalbe to people who have logged in, obviously you only do this with an include.

Code:
if ($_SESSION['user_logged_in']=="ooooYESBabyImIn"){ Let the person view stuff }else{ Tell them they have to log in and give them a log in form }
__________________
Wot Speeling Mishtake?
  Reply With Quote