Topic: PHP - retreive contents of a password protected page (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28276" title="Pages that link to Topic: PHP - retreive contents of a password protected page (Page 1 of 1)" rel="nofollow" >Topic: PHP - retreive contents of a password protected page <span class="small">(Page 1 of 1)</span>\

 
H][RO
Paranoid (IV) Inmate

From: Australia
Insane since: Oct 2002

posted posted 07-30-2006 16:38

Hi folks..

You know how you used to be able to in IE and can still do in other browsers, access a password protected site via the URL. For example http://usernameassword@mysite.com


Is there a way to do this, via php and retrive the contents that would have been outputted to html. Currently you cant do this in IE6 normally because in a patch microsoft removed the ability to do so. Im not sure if this would effect things serverside since php isnt technically using a browser to get the URL, but im really not sure.

Any suggestions?

divinechaos
Bipolar (III) Inmate

From:
Insane since: Dec 2001

posted posted 07-30-2006 18:19

Yes, take a look at the CURL docs: http://ca.php.net/curl

quote:
libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.



I'm convinced it would also be possible by hand with file handlers (fopen, fread), but the above will be much easier.

Cheers,
DC

H][RO
Paranoid (IV) Inmate

From: Australia
Insane since: Oct 2002

posted posted 07-31-2006 02:40

Awesome thanks, looks like it should do the trick. I have heard about curl but never used it, thought it was some big extension like PEAR that my host didnt have installed.

Turns out the php is compiled with it! Now i can make a new front end to cpanel for my clients hoorahh



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu