Re: Password Protect Directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jason Karns wrote:
> I'm trying to find a way to password protect a directory.  I currently have
> an authentication and authorization system in place for pages in my
> directory.  I'd prefer to use my existing system somehow (as it includes
> OpenID authentication) as opposed to using htaccess and HTTP Auth.  The
> only
> idea of found is to use mod_rewrite to have a PHP script serve up all the
> files in the particular directory and have the authentication handled in
> this script.  This just seems a little 'hackish' to me.

why?

as an alternative you could setup apache to force php to handle *all*
files in that directory using a Files directive inconjunction with a
auto_prepend_file directive for that dir that does the authentication and
pumps out the requested file - same affect as using mod_rewrite without
actually using mod_rewrite.

>  Is there any other
> way to password protect a directory with PHP?  I'd even entertain the idea
> of using HTTP Auth if I could get PHP to 'login'.  For instance, the user
> logs in at another page in the site, and then during the login process, PHP
> sets the HTTP Auth password so when the files in the directory are
> accessed,
> the user has already been logged in.
> 
> Any suggestions would be great, I can't find anything else online.
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux