Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP and Apache authentication

Status
Not open for further replies.

awingnut

Programmer
Feb 24, 2003
759
US
I am somewhat a novice with apache authentication so I'm not sure how to accomplish what I want. I have a protected directory that requires authentication (.htaccess). This brings up an automatic dialog for authenticating anytime a user tries to access something in that directory. However, that is not the behavior I want. I need to perform some prelimary functions with PHP prior to allowing the user access. Therefore I have a public PHP form in which the user provides a username/password. I can authenticate from that form using a MySQL query. Once authenticated and the preliminary work is done I want to load the first page in the protected directory. However, this requires a second log in for the user. What I want is to tell Apache that the user has already authenticated from my public PHP page so the second login is avoided. What function do I use to accomplish this? TIA.
 
When a user points his web browser to a server-password-protected resource, the browser either prompts the user for an id and password or automatically logs the user in from remembered credentials.

If your script causes the browser to prompt the user for credentials, then the browswer might remember those credentials and automatically use them for further credential requests by the server.

See the PHP online manual chapter titled, "HTTP authentication with PHP" for more information.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top