...

View Full Version : how to add checks for accessing the pages



fanta
11-26-2010, 08:32 AM
hi!
i am working in php. i want to know how can i add checks. like if a user is not login then he can not viwe some pages.
is question clear??

firepages
11-26-2010, 12:46 PM
lots & lots of ways :) , a simple example would be to use sessions or cookies, create a session or cookie variable when the user logs in then check for that variable on any secure pages..



session_start();
if(!isset($_SESSION['auth']['id'])){
header('location: login.php');
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum