How can a PHP script determine if it is running in a directory secured by Apache? That is, has the user been challenged to enter a username and password to enable Apache to serve pages from a directory secured by it's .htaccess file with "AuthType Basic" etc. directives.
Thanks in advance.
Pete
Can PHP tell if the dir a script is running in is secured?
Moderator: General Moderators
-
petersterling
- Forum Newbie
- Posts: 1
- Joined: Thu Jan 14, 2010 7:34 am
Re: Can PHP tell if the dir a script is running in is secured?
For Basic authentication you'll have $_SERVER["PHP_AUTH_USER"] and $_SERVER["PHP_AUTH_PW"].
For Digest you get $_SERVER["PHP_AUTH_DIGEST"].
For Digest you get $_SERVER["PHP_AUTH_DIGEST"].