[ac1D]
25.04.2010, 17:43
Скрипт нормально гетит страницу, но пост запрос , видимо, не отсылается, что делаю не так??
<?php
$fp = fsockopen('inbox.chmail.ru',80);
if ($fp)
{
$headers = "GET /register/ HTTP/1.1\r\n";
$headers .= "Host: inbox.chmail.ru\r\n";
$headers .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9\r\n";
$headers .= "Connection: Close\r\n";
$headers .= "Referer: http://chmail.ru/\r\n\r\n";
$line = "";
fwrite($fp, $headers);
while(!feof($fp))
{
$line .= fgets($fp, 1024);
}
preg_match('|<img src="(.*)" width=130 height=35 border=0>|mi', $line, $out);
$captcha = $out[1];
echo '<img src="http://inbox.chmail.ru/'.$captcha.'">';
print '
<form method=get>
<input type=text name=code> - Code<br>
<input type=submit value="Go">
</form>
';
$name = rand(100,1000);
$postdata = "login=superman437842&domain=chmail.ru&passw1=debbidebi&passw2=debbidebi&question=%CA%E0%EA+%E7%EE%E2%F3%F2+%C2%E0%F8%F3+%F 1%EE%E1%E0%EA%F3&answer=Mario&email=&name=Andone&gender=male&day=20&month=10&year=1989&country=Russia&city=Moscow&gmt=16&sec_code=".$_GET['code']."&agree=1&submit=%C7%E0%F0%E5%E3%E8%F1%F2%F0%E8%F0%EE%E2%E0% F2%FC%F1%FF";
$header = "POST /register/ HTTP/1.1\r\n";
$header .= "Host: inbox.chmail.ru\r\n";
$header .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9\r\n";
$header .= "Referer: http://inbox.chmail.ru/register/\r\n";
$header .= "Content-Length: ".strlen($postdata)."\r\n";
$header .= "Connection: Close\r\n\r\n";
$header .= $postdata."\r\n\r\n";
fputs($fp, $header);
$l = "";
while(!feof($fp))
{
$l .= fgets($fp, 1024);
}
echo $l;
}
?>
<?php
$fp = fsockopen('inbox.chmail.ru',80);
if ($fp)
{
$headers = "GET /register/ HTTP/1.1\r\n";
$headers .= "Host: inbox.chmail.ru\r\n";
$headers .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9\r\n";
$headers .= "Connection: Close\r\n";
$headers .= "Referer: http://chmail.ru/\r\n\r\n";
$line = "";
fwrite($fp, $headers);
while(!feof($fp))
{
$line .= fgets($fp, 1024);
}
preg_match('|<img src="(.*)" width=130 height=35 border=0>|mi', $line, $out);
$captcha = $out[1];
echo '<img src="http://inbox.chmail.ru/'.$captcha.'">';
print '
<form method=get>
<input type=text name=code> - Code<br>
<input type=submit value="Go">
</form>
';
$name = rand(100,1000);
$postdata = "login=superman437842&domain=chmail.ru&passw1=debbidebi&passw2=debbidebi&question=%CA%E0%EA+%E7%EE%E2%F3%F2+%C2%E0%F8%F3+%F 1%EE%E1%E0%EA%F3&answer=Mario&email=&name=Andone&gender=male&day=20&month=10&year=1989&country=Russia&city=Moscow&gmt=16&sec_code=".$_GET['code']."&agree=1&submit=%C7%E0%F0%E5%E3%E8%F1%F2%F0%E8%F0%EE%E2%E0% F2%FC%F1%FF";
$header = "POST /register/ HTTP/1.1\r\n";
$header .= "Host: inbox.chmail.ru\r\n";
$header .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9\r\n";
$header .= "Referer: http://inbox.chmail.ru/register/\r\n";
$header .= "Content-Length: ".strlen($postdata)."\r\n";
$header .= "Connection: Close\r\n\r\n";
$header .= $postdata."\r\n\r\n";
fputs($fp, $header);
$l = "";
while(!feof($fp))
{
$l .= fgets($fp, 1024);
}
echo $l;
}
?>