here's what i do:
...
function HTTP_MSG ($http_msg, $line)
{
return $http_msg.$line."\r\n";
}
...
$host = 'localhost';
$path = 'test.php';
$USER = '9bala';
$PASSWORD = 'sincreto';
$Message = "Username=$USER&Password=$PASSWORD&login=Login&ssl=";
$ContentLength = strlen ($Message);
$msg = HTTP_MSG ($msg, "POST /$path HTTP/1.1");
$msg = HTTP_MSG ($msg, "HOST: $host");
$msg = HTTP_MSG ($msg, "ACCEPT: /");
$msg = HTTP_MSG ($msg, "Referer: http://$host/$path");
$msg = HTTP_MSG ($msg, "Content-length: $ContentLength");
$msg = HTTP_MSG ($msg, "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 95)");
$msg = HTTP_MSG ($msg, "Content-Type: application/x-www-form-urlencoded");
$msg = HTTP_MSG ($msg, "Connection: Keep-Alive");
$msg = HTTP_MSG ($msg, "");
$msg = HTTP_MSG ($msg, $Message);
$msg = HTTP_MSG ($msg, "");
$fp = pfsockopen ($host, 80, &$errno, &$errstr, 30);
if (!$fp) {
echo "ERROR_STRING=$errstr ERR_NO($errno)<br>\n";
} else {
fwrite ($fp, $msg);
while (!feof($fp)) echo=fgets ($fp,1024);
fclose ($fp);
}