Показать сообщение отдельно

  #6  
Старый 28.06.2007, 14:20
SIBON
Banned
Регистрация: 13.07.2006
Сообщений: 13
С нами: 10436066

Репутация: 3
По умолчанию

Цитата:
Сообщение от hhover  
PHP код:
$post_data "a=1&b=2&c=3&d=4";
$length strlen $post_data );

$header "POST http://forum.antichat.ru/index.php HTTP/1.0\r\n" .
"Content-Type: application/x-www-form-urlencoded\r\n".
"Host: forum.antichat.ru\r\n".
"Content-Length: $length\r\n\r\n".
$post_data
Заголовок такой. Остальное аналогично.
делаю вот так

PHP код:
<?php 
$fp 
fsockopen("www.passport.yandex.ru"80$errno$errstr30); 
if (!
$fp) { 
    echo 
"$errstr ($errno)<br />\n"
} else { 

 
$post_data "retpath=http%3A%2F%2Fmail.yandex.ru%2F&timestamp=1182979341312&login=zz&passwd=zz"

$length strlen $post_data ); 

$header "http://passport.yandex.ru/passport?mode=auth  HTTP/1.0\r\n" 
$header ="Content-Type: application/x-www-form-urlencoded\r\n"
$header ="Host: passport.yandex.ru\r\n"
$header ="Content-Length: $length\r\n\r\n"
$post_data;  

    
fwrite($fp$header); 
    while (!
feof($fp)) { 
        echo 
fgets($fp128); 
    } 
    
fclose($fp); 

?>
пишет
Bad Request
Your browser sent a request that this server could not understand.
Invalid URI in request http://passport.yandex.ru/passport?mode=auth HTTP/1.0
 
Ответить с цитированием