Jump to content

[SOLVED] http authenticate auto login?


dj-kenpo

Recommended Posts

Hi all,

 

you know the apache built in authenticate boxes? username+password.

is it possible to run a php script that can log into that?

do I send the username/pass as a post?

is this possible?

I've searched everywhere and only found info on making one.

 

I don't want to make one, I want to log into one via  a php script.

 

reason: dreamhost uses that for the login for the stats page, I want to read the data from the page in a php script, but first I need to log in....

 

 

thanks for any help

Link to comment
https://forums.phpfreaks.com/topic/44527-solved-http-authenticate-auto-login/
Share on other sites

anyone?

 

the only thing I found was http://username:[email protected]/dir

 

but with $content=file_get_contents("http://username:[email protected]/dir",FALSE,NULL,0,200);

that simply returns "failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required".

ok here's the deal:

 

a user/login page is indeed a form

only way to make a form work, and to post variables to a form process page is to have a HUMAN fill out or press teh submit button

 

HOWEVER you can use the curl library in php and curl functions to use php to submit form variables directlyt to the form processing script

 

research curl functions in php.net, thats how you can POST to a form without actually filling out or pressin teh submit button, a php script can do this

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.