$PostUrl="http://somedomain.com/blabla.asp";
$PostData="var1=value";
$OkString="";
$Url=substr($PostUrl,strpos($PostUrl,"//")+2);
$Url=substr($Url,strpos($Url,"/"));
$HostName=substr($PostUrl,strpos($PostUrl,"//")+2);
$HostName=substr($HostName,0,strpos($HostName,"/"));
if(strpos($HostName,":")){
$HostPort=substr($HostName,strpos($HostName,":")+1);
if(!is_numeric($HostPort)){
$HostPort=80;
}
}
else{
$HostPort=80;
}
$fp=fsockopen($HostName, $HostPort, $errno, $errstr, 30);
if (!$fp){
echo "$errstr ($errno)<br />\n";
}
else {
$out = "POST $Url HTTP/1.1\r\n";
$out .= "Host: $HostName\r\n";
$out .= "Content-type: application/x-www-form-urlencoded\r\n";
$out .= "Accept-Language: ru\r\n";
$out .= "Connection: Keep-Alive\r\n";
$out .= "Cache-Control: no-cache\r\n";
$out .= "Content-length: ".strlen($PostData)."\r\n\r\n".$PostData;
stream_set_timeout($fp, 30);
fputs($fp, $out);
$ech = fgets($fp);
fclose($fp);
}