
10.04.2010, 20:39
|
|
Познавший АНТИЧАТ
Регистрация: 15.01.2008
Сообщений: 1,168
С нами:
9642449
Репутация:
606
|
|
PHP код:
<?php
function post($host, $script, $cont){
$respons="";
$postsock = fsockopen($host, 80, $errno, $errstr, 60);
if (!$postsock) echo $errstr($errno);
else
{
$head = "POST $script HTTP/1.1\r\n";
$head .= "Host: $host\r\n";
$head .= "Connection: close\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;
}
echo post('goldtown.ru', '/admin.php', 'user_login=admin&&password=pass');
|
|
|