fsockopen via MS-Proxy authentification
| From: | Kriegers Horst | Date: | Fri, 08 Feb 2002 09:10:46 +0000 |
| Subject: | fsockopen via MS-Proxy authentification | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-11908@lists.php.net to get a copy of this message | ||
Hi all,
I wish to fetch an internet web page.
Oour internet access is through MS-Proxy server 2.0 with NTLM
authentification (domain\user:password).
I experience an access probleme.
Here you are the result:
proxy_srv_01:80 is available
HTTP/1.0 407 Proxy Access Denied Server: Microsoft-IIS/3.0 Date: Fri, 08 Feb
2002 08:15:35 GMT Proxy-Authenticate: NTLM Proxy-Authenticate: Basic
realm="proxy_srv_01.stg.swiss"
Here you are my code:
<?
$user="lnt_01\test"; // DomainNT\UserName
$pass="test"; // UserPassword
$proxy_s = "proxy_srv_01"; // Proxy server to Internet
$proxy_p = "80"; // Proxy port
$myfiles = "http://www.phpscripts-fr.net"; // URL to fetch
$datei = fsockopen($proxy_s, $proxy_p, &$errno,&$errstr, 30);
if( !$datei )
{
echo "<font color=red><b>$proxy_s:$proxy_p isn't available
!</b></font>";
exit();
} else {
echo "<font color=green><b>$proxy_s:$proxy_p is
available</b></font><br>";
fputs($datei,"GET $myfiles/ HTTP/1.0 \r\n\r\n");
while (!feof($datei))
{
echo $zeile = fread($datei,1000);
}
}
?>
Is something erroneous in my code?
If somebody can help me, I will be really happy
Thanks
Horst