|
Posted by Jerry Stuckle on 10/24/06 01:30
laredotornado@zipmail.com wrote:
> I have seen .htaccess files, but how can they be built so that they
> read from a database of stored username and passwords?
>
> Thanks, - Dave
>
>
> Ron wrote:
>
>><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
>
>
If you're using a MySQL database, see mod_auth_mysql (available on
sourceforge.net).
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|