Protect Access to a Directory
| From: | Pushpinder Singh Garcha | Date: | Tue, 04 Feb 2003 20:06:01 +0000 |
| Subject: | Protect Access to a Directory | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-134324@lists.php.net to get a copy of this message | ||
Hi,
I am using PHP and MySQL in my application. I have created a Login System for using "Sessions". The problem that I am facing is that I need to protect a large number of pages in my website. So I have tried to use this method and it works fine for me :
<? session_start();
if (session_is_registered("valid_user"))
include ('guest.html');
else include 'not_logged_in.php';
?>
I get stumped here .... in order to be able to insert this code I have to write for each of the 400 html files, 400 php files with the same name. Most of the files are arranged in the form of directories. Is there a better way to be able to do this (Using PHP and MySQL). Thanks in advance !
Best Wishes
Pushpinder Singh Garcha
_________________________________
Web Architect