Re: reverse http authentication

From: Date: Sun, 18 Feb 2007 16:58:58 +0000
Subject: Re: reverse http authentication
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-248997@lists.php.net to get a copy of this message
Chris W wrote: > I want to read a page that is protected with http authentication. How > do I pass the user name and password to be authenticated with my php > code? > Have you tried to just put the username and password in the URL? I'm not sure if this works, its so simple its worth a try. Instead of using (whatever function you use) like the first example try changing it like the second: x('http://example.com/protected/page.php'); x('http://username:password@example.com/protected/page.php'); Of course it depends on the 'x' you are using... I'm really not sure if PHP's functions will take care of moving that username/password information into the header of the HTTP request or just leave it there. Travis Doherty

« previous php.general (#248997) next »