Re: fsockopen with auth
| From: | Ryan J Nichols | Date: | Thu, 07 Sep 2000 20:55:16 +0000 |
| Subject: | Re: fsockopen with auth | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15774@lists.php.net to get a copy of this message | ||
"my bad"
Authorization: Basic <base 64 encoded string> (not authentication)
encode the string "username:password", this means if your login is 'foo' and
your pass is 'bar' you encode the string 'foo:bar'
rfc 2617 covers http authentication
(http://www.rfc-editor.org/rfc/rfc2617.txt)
hope this helps, sorry for the mixup =)
-r
----- Original Message -----
From: "bill" <bill@billtron.com>
To: <php-general@lists.php.net>; "Ryan J Nichols" <ryan@globali.net>
Sent: Thursday, September 07, 2000 4:21 PM
Subject: Re: [PHP] fsockopen with auth
> 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
>
>
> --
> 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
>
>