note 9768 added to fsockopen
| From: | t dot hodder at globalgold dot co dot uk | Date: | Wed, 22 Nov 2000 19:55:14 +0000 |
| Subject: | note 9768 added to fsockopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7990@lists.php.net to get a copy of this message | ||
You can post to a script that uses basic authentication if you create the header like this and
insert it into the relevant script above;
// Build the header
$header = "POST /path/to/script.cgi HTTP/1.0\r\nAuthorization: Basic ";
$header .= base64_encode("$username:$password") . "\r\n";
$header .= "Content-type: application/x-www-form-urlencoded\r\n";
$header .= "Content-length: " . strlen($request) . "\r\n";
$header .= "Connection: close\r\n\r\n";
http://www.php.net/manual/function.fsockopen.php