Re: user and password for socket connection
| From: | Erwin | Date: | Thu, 12 Sep 2002 10:05:19 +0000 |
| Subject: | Re: user and password for socket connection | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116123@lists.php.net to get a copy of this message | ||
> $hostname="https://www.url.com";
> $port=443;
> $loginmessage="GET / HTTP/1.0\r\nHost: www.php.net\r\n\r\n";
> $timeout=30;
> $fp = fsockopen ($hostname, $port, $errno, $errstr, $timeout);
> if (!$fp) {
> echo "$errstr ($errno)<br>\n";
> } else {
> fputs ($fp, $loginmessage);
> while (!feof($fp)) {
> echo fgets ($fp,128);
> }
> fclose ($fp);
> }
You could try using
$url = "https://$user:$password@www.url.com"
I haven't tried this yet ;-))
HTH
Erwin