Re: fsockopen with auth
| From: | bill | Date: | Thu, 07 Sep 2000 20:21:53 +0000 |
| Subject: | Re: fsockopen with auth | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15771@lists.php.net to get a copy of this message | ||
Hi Ryan,
Thanks for your input. I tried it but it didn't work.
Do I need a colon ( : ) after the word "Basic" ?
Do I need to base64_encode both the username and password or just the password?
Any other suggestions?
thanks,
bill
Ryan J Nichols wrote:
> 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
> >
> >
>
> --
> 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