note 9768 deleted from function.fsockopen by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 21:56:17 +0000 |
| Subject: | note 9768 deleted from function.fsockopen by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22249@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";