Re: restricting access to files using PHP
| From: | David T-G | Date: | Wed, 12 Feb 2003 12:48:20 +0000 |
| Subject: | Re: restricting access to files using PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-135301@lists.php.net to get a copy of this message | ||
Shams --
..and then Shams said...
%
% Hi,
Hi!
%
..
% however, how do I restrict people from accessing HTML files in that
You've seen the suggestions from others to change your .html files. You
may or may not want to do that.
If you don't want to do that, then you need a .htaccess file. You don't
necessarily, however, need a .htpasswd file as well; just make your php
script the authenticator:
AuthName AccessYourDirectory
AuthType Basic
AuthExternal /path/to/your/script
order allow,deny
allow from all
require valid-user
This is untested code, but you get the idea. You may have to define your
external auth script with some name and then call it; our version of this
uses NickName instead of /path/to/your/script and in the httpd.conf file
we have
AddExternalAuth NickName "/path/to/script"
SetExternalAuthMethod NickName pipe
and I dunno if 1) adding and nicknaming is necessary or 2) you can do it
in a .htaccess file instead of having to put it in the http.conf file.
HTH & HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!