Собственно сабж..
Сервер в ответ вместо 200-го отдает 302-й статус
Код | <?php
$fp = fsockopen('www.yandex.ru' , 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "GET /yandsearch?text=%E3%FB HTTP/1.1\r\n"; $out .= "Host: www.yandex.ru\r\n"; $out .= "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204\r\n"; $out .= "Referer: http://www.yandex.ru/\r\n"; $out .= "Accept: text/xml,application/xml,application/xhtml+xml,"; $out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out); while (!feof($fp)) { echo fgets($fp, 128); } fclose($fp); }
exit; ?>
|
В ответ получаем:
Код | Found
The document has moved here.
|
|