jeppers Posted May 3, 2007 Share Posted May 3, 2007 he there i am a newbe at this but i hope you will help me my problem is that i can't get my session to work i want to give user areas but i have no idea on how to do it.. i do have a session up which direct you to a login page but i don't no how to define an area hear is my code please help man in destress arrrrrrrrrr <?php include('title.inc.php'); // include MySQL connector function if (! @include('mysql\conn_mysql.inc.php')) { echo 'Sorry, page unavailable'; exit; } thanks Quote Link to comment Share on other sites More sharing options...
taith Posted May 3, 2007 Share Posted May 3, 2007 um... you dont have any $_SESSION's in there... Quote Link to comment Share on other sites More sharing options...
jeppers Posted May 3, 2007 Author Share Posted May 3, 2007 sorry i copied the wrong script session_start(); // if session variable not set, redirect to login page if (!isset($_SESSION['authenticated'])) { header('Location: http://localhost/login.php'); exit; } ?> Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted May 3, 2007 Share Posted May 3, 2007 you need to be able to assign another session variable and set its value to the area(s) that they have access to. This could be one directory in your site or an array of values that could be checked against the the database to help control access to pages. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.