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 Link to comment https://forums.phpfreaks.com/topic/55118-how-can-i-restrict-access-to-files-to-logged-in-users-only/ 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"); } ?> Link to comment https://forums.phpfreaks.com/topic/55118-how-can-i-restrict-access-to-files-to-logged-in-users-only/#findComment-272488 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.