|
Posted by Ron on 10/23/06 18:00
<laredotornado@zipmail.com> wrote in message
news:1161622661.162877.145300@e3g2000cwe.googlegroups.com...
> Hello,
>
> I'm using PHP 4.4.4 with MySQL 5.0. I have a USERS table wher I store
> a username and password for each user. I have a directory (containing
> both HTML and PHP files) that I would like only logged in users to
> access. What is the simplest scheme for password protecting thsi
> directory? I would prefer not to touch every page and add access
> control logic, but if that's the easiest way, so be it.
>
> Your thoughts are greatly appreciated. - Dave
Dave,
if your server supports it you could use .htaccess files (apache style) to
control user access.
otherwise you can write a simple access control system and make it a
require_once in each PHP file.
Only the .htaccess will protect the html files on their own, It is often
useful to put pages and fragments that you don't want users to discover in
directories outside of the browsing path of the user, then get PHP to
include or require them as needed.
Cheers
Ron
[Back to original message]
|