faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

18 of 31 people (58%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

I'm protecting a dir with .htaccess. How can I get the password?

Feb 24th, 2000 11:19
Aubin Paul, Nathan Wallace, Rob


In PHP3, the username and password obtained from the http login are
available in $PHP_AUTH_USER and $PHP_AUTH_PW. You can either generate
the headers in PHP with:

Header(""WWW-Authenticate: Basic realm=\"My Realm\"");
Header("HTTP/1.0 401 Unauthorized");

or use an .htaccess file.