Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   PHP, PERL, MySQL, JavaScript (https://forum.antichat.xyz/forumdisplay.php?f=37)
-   -   Php авторизация на fotostrana.ru (https://forum.antichat.xyz/showthread.php?t=163358)

mandebist 13.12.2009 23:46

Php авторизация на fotostrana.ru
 
Del Тему

Deathdreams 14.12.2009 00:06

Снифер в руки , кури пакеты

Player#1 14.12.2009 00:06

Не знаю какие проблемы тут могут быть...
Вот пример авторизации при помощи curl:

PHP код:

function curl($url$post)
    {
    
$ch curl_init();  
    
curl_setopt($chCURLOPT_URL$url); 
    
curl_setopt($chCURLOPT_HEADER1);
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);
    
curl_setopt($chCURLOPT_COOKIEJAR"cookie.txt");
    
curl_setopt($chCURLOPT_COOKIEFILE"cookie.txt");
    
curl_setopt($chCURLOPT_REFERER"http://fotostrana.ru/");
    
curl_setopt($chCURLOPT_USERAGENT'Mozilla/5.0');
    
curl_setopt($chCURLOPT_POST1);
    
curl_setopt($chCURLOPT_POSTFIELDS$post);
    
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    
$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

PHP код:

<?

set_time_limit
(0);
error_reporting(E_ERROR E_PARSE);

function 
curl($url,$post)
    {
    
$ch curl_init();  
    
curl_setopt($chCURLOPT_URL$url); 
    
curl_setopt($chCURLOPT_HEADER1);
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);
    
curl_setopt($chCURLOPT_COOKIEJAR"cookie.txt");
    
curl_setopt($chCURLOPT_COOKIEFILE"cookie.txt");
    
curl_setopt($chCURLOPT_REFERER"http://fotostrana.ru/");
    
curl_setopt($chCURLOPT_USERAGENT'Mozilla/5.0');
    
curl_setopt($chCURLOPT_POST1);
    
curl_setopt($chCURLOPT_POSTFIELDS$post);
    
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    
$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);
 }


?>

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


Время: 13:30