Re: fsockopen with auth
| From: | bill | Date: | Thu, 07 Sep 2000 20:54:57 +0000 |
| Subject: | Re: fsockopen with auth | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15775@lists.php.net to get a copy of this message | ||
Hi Ryan,
Further info: A RFC 2617 document shows it as
Authorization: Basic blah blah
instead of
Authentication: Basic blah blah
Yes, I know. It took me a while to see the difference. Also, it shows no
colon after "Basic".
I do get a response form the server. Perhaps it is helpful:
Headers are:
HTTP/1.1 401 Authorization Required
Date: Thu, 07 Sep 2000 20:48:44 GMT
Server: Apache/1.3.6 (Unix) AuthMySQL/2.20
WWW-Authenticate: Basic realm="blah blah"
Connection: close
Content-Type: text/html
The rest is generic 401 Authorization required stuff. It reads:
<H1>Authorization Required</H1>
This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.
I'm open to suggestions.
Thanks again,
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