faqts : Computers : Programming : Languages : PHP : Common Problems : HTTP Headers

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 7 people (43%) answered Yes
Recently 3 of 7 people (43%) answered Yes

Entry

What is code for if User hasn't logged in (tried toskip login page) then redirect back to login page

Jan 12th, 2004 04:20
Eyad Saleh, Dave Brown,


Hello,

when the users login to your system, you can save the username in a 
session variable, name it anything like "user_name" .... and place a 
php code in every php page to test if that variable exist or not, if 
it exist, then, this is a valid user, otherwise redirect him to the 
login page ...

regards