<?php function postzapros($host, $script, $ref, $cont){ $respons=""; $postsock = fsockopen($host, 80, $errno, $errstr, 30); if(!$postsock){ echo $errstr($errno); }else{ $head ="POST $script HTTP/1.1\r\n"; $head .="Host: $host\r\n"; $head .="User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14\r\n"; $head .="Accept-Language: ru,ru-RU;q=0.9,en;q=0.8\r\n"; $head .="Keep-Alive: 300\r\n"; $head .="Connection: keep-alive\r\n"; $head .="Referer: $ref\r\n"; $head .="Content-Type: application/x-www-form-urlencoded\r\n"; $head .="Content-Length: ".strlen($cont)."\r\n"; $head .="\r\n$cont\r\n"; } fwrite($postsock, $head); while(!feof($postsock)){ $respons .=fgets($postsock, 1024); } fclose($postsock); return $respons; } $cont = "page=http%3A%2F%2Ffoto.mail.ru%2Fcgi-bin%2Fphoto%2Falbums&Login=логин&Domain=mail.ru&Password=пароль"; echo postzapros("foto.mail.ru", "/cgi-bin/auth", "http://foto.mail.ru/", $cont); ?>
$head .="\r\n$cont\r\n";
$head .="\r\n\r\n$cont";
$head .="Keep-Alive: 300\r\n"; $head .="Connection: keep-alive\r\n";
$head .="Connection: close\r\n";