fsockopen and HTTP Authorization

From: Date: Thu, 28 Feb 2002 01:47:06 +0000
Subject: fsockopen and HTTP Authorization
Groups: php.general 
Request: Send a blank email to php-general+get-86502@lists.php.net to get a copy of this message
Hello, I try to do a HTTP Authorization with a fsockopen, but it doesn't seem to work. Who can help? $user and $passwd are set well, my code: -- $auth=base64_encode($user.":".$passwd); $header="GET /pa2/ HTTP/1.0\r\n\r\n"; $header.="Accept: text/html\r\n"; $header.="Authorization: Basic $auth\r\n\r\n"; $fp = fsockopen ("localhost", 80, $errno, $errstr, 30); if (!$fp) echo "$errstr ($errno)<br>\n"; else { fputs ($fp, $header); while (!feof($fp)) echo fgets ($fp,128); } fclose ($fp); -- Thanks, Bas

« previous php.general (#86502) next »