[thelist] send HTTP authentication from PHP page?

apathetic apatheticgenius at gmail.com
Wed Oct 6 13:54:23 CDT 2004


On Wed, 06 Oct 2004 13:29:54 -0400, noah <noah at tookish.net> wrote:
> >>Hi all, does anyone know if is possible for a PHP page to send the
> >>correct headers to login to another page that requires HTTP
> >>authentication?
> >
> > Access the page using this form of URL:
> > http://username:password@www.yoursite.com/
> 
> Unfortunately, this won't work in versions of IE/Windows with a recent
> security update . See here:

It seems like either one of us may have misunderstood the question. 
It sounded to me like Theodore wanted to use PHP to get the contents
of another page which was protected by HTTP authentication.

In this case the HTTP client is PHP and the behaviour of IE, regarless
of security updates, is irrelevant.

You can get a protected page using something like:

<?php
    $page = file( 'http://username:password@www.yoursite.com/' );
?>

Tim

-- 
www.apatheticgenius.com
www.hyperlinkage.com - Free online RSS reader


More information about the thelist mailing list