mesh2005 Posted June 11, 2007 Share Posted June 11, 2007 I have a folder containing file1,file2,file3. I created a login system that sets the $_SESSION['id'] to a value if the user logged it. How can I restrict the access to my folder? I want the logged in users only to access it. Please help. Thank you Quote Link to comment Share on other sites More sharing options...
chocopi Posted June 11, 2007 Share Posted June 11, 2007 Something like this: <?php session_start(); if(isset($_SESSION['id'])) { // Your page } else { // redirect user is $_session['id'] is not set $page = your_page.php; header("Location: $page"); } ?> 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.