vinpkl Posted May 21, 2010 Share Posted May 21, 2010 hi all i m having two separate restricted access folders based on separate login forms and sessions. i m using same technique for both folder files. everything works fine for first folder but having trouble with second folder files. i have a form page in second folder which is accessible only after the user gets logs in. when a user logs in second folder then a session repair_access is set to true for second folder. $_SESSION['REPAIR_ACCESS'] = true; after loggin the user enter information in the form, when he click submit button the information is getting stored in database correctly but he is redirected to index.php which is login page. i m not able understand that if the user reaches the form page that means the SESSION has been set to true but then why is he redirected back to loginpage when he clicks submit button. this is my config file for second folder $conn3=mysql_connect("localhost","root","") or die(mysql_error()); mysql_select_db('repair_data', $conn3); session_start(); this code is on top of my form in second folder <?php require_once("config.php"); if(!isset($_SESSION['REPAIR_ACCESS'])) header("Location:index.php"); $msg=""; ?> Are the sessions conflicting with anything ? vineet 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.