PDA

Просмотр полной версии : Php авторизация на fotostrana.ru


mandebist
13.12.2009, 23:46
Del Тему

Deathdreams
14.12.2009, 00:06
Снифер в руки , кури пакеты

Player#1
14.12.2009, 00:06
Не знаю какие проблемы тут могут быть...
Вот пример авторизации при помощи curl:


function curl($url, $post)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch, CURLOPT_REFERER, "http://fotostrana.ru/");
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$res_curl = curl_exec($ch);
curl_close($ch);
return $res_curl;
};

$email = "email";
$pass = "pass";
$url = "http://fotostrana.ru/user/login/";
$post = "submitted=1&user_email=".$email."&user_password=".$pass;
echo htmlspecialchars(curl($url, $post));

mandebist
14.12.2009, 01:29
Player#1 Большое спасибо за помощь

mandebist
16.12.2009, 04:09
<?

set_time_limit(0);
error_reporting(E_ERROR | E_PARSE);

function curl($url,$post)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch, CURLOPT_REFERER, "http://fotostrana.ru/");
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$res_curl = curl_exec($ch);
curl_close($ch);
return $res_curl;
};

$email = "444";
$pass = "444";
$url = "http://fotostrana.ru/user/login/";
$post = "submitted=1&user_email=".$email."&user_password=".$pass;
echo htmlspecialchars(curl($url, $post));

for($i=1;$i<99;$i) {
$qwe=$i++;


$url = "http://fotostrana.ru/tlogprofile/comment/add?tlogId=15540678&display=room&comment_text=test".$qwe."&ajax=true";
$res = connect($url,$post);

print $result;
flush();
print $qwe."\n";
flush();

sleep(1);
}


?>

Немогу разобратся что нетак помогите плиз ...