How do I auto-login to a protected site?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Using Apache web server, I am protecting certain directories with
.htaccess files.  Is there a way in PHP where I can automatically
sjbmit login credentials without having to type them into the gray box
each time?  I'm using PHP 4.4.4 if that helps.

Thanks for any advice, - Dave

Re: How do I auto-login to a protected site?

send the username and password by http headers, and it will pass the
box and auto login..
Use them with WWW-Authenticate, I do not remember the code, but this
will lead you to the right way.

For php/ajax/javascript tutorials and tips, visit me on my blog at

Re: How do I auto-login to a protected site?

Dave --

If you have libcurl installed and you've compiled PHP with the
appropriate option, you can use curl to accomplish this task.  You
would use the CURLOPT_HTTPAUTH and CURLOPT_USERPWD options to submit
your credentials.

For more information about PHP and curl, visit this URL:

Hope this helps.  :)

Geoffrey wrote:
Quoted text here. Click to load it

Site Timeline