Re: fsockopen with auth
| From: | Ryan J Nichols | Date: | Thu, 07 Sep 2000 20:04:50 +0000 |
| Subject: | Re: fsockopen with auth | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15770@lists.php.net to get a copy of this message | ||
in the httpd headers send Authentication: Basic <string>
where string is 'username:password' base64 encoded
so something like
$fp = fsockopen("www.yahoo.com", 80);
fputs ($fp, "GET / HTTP/1.0\r\nHost: www.yahoo.com\r\nAuthentication: Basic
".base64_encode("username:password")."\r\n\r\n");
hope this helps
-r
----- Original Message -----
From: "bill" <bill@billtron.com>
To: <php-general@lists.php.net>
Sent: Thursday, September 07, 2000 3:18 PM
Subject: [PHP] fsockopen with auth
> How can I use fsockopen() with apache auth?
>
> From my browser, I can type
>
> http://name:password@www.mydomain.com
>
> and it will allow me into password protected directories.
>
> How can I do the equivalent using fsockopen?
>
> thanks,
>
> bill
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>