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

  #2  
Старый 11.02.2010, 13:52
b3
Постоянный
Регистрация: 05.12.2004
Сообщений: 647
С нами: 11278406

Репутация: 818


По умолчанию

Цитата:
Сообщение от Compton  
что-то не то
PHP код:
<?php
if(login('xxxxx','xxxxxxxxx'))
echo 
'auth ok<br>';


function 
login($login,$pass


$ch curl_init('https://passport.yandex.ru/passport?mode=auth'); 
curl_setopt($chCURLOPT_USERAGENT'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3'); 
curl_setopt($chCURLOPT_REFERER'https://passport.yandex.ru/passport?mode=auth'); 
curl_setopt($chCURLOPT_COOKIEJAR'./cook.txt'); 
curl_setopt($chCURLOPT_POST1); 
curl_setopt($chCURLOPT_POSTFIELDS"login=$login&passwd=$pass"); 
curl_setopt($chCURLOPT_TIMEOUT10); 
curl_setopt($chCURLOPT_FOLLOWLOCATION1); 
curl_setopt($chCURLOPT_RETURNTRANSFER1); 
curl_setopt($chCURLOPT_SSL_VERIFYPEER0); 
$res curl_exec($ch); 
if(
preg_match('#https:\/\/passport\.yandex.ru\/passport\?mode=logout#',$res)) {

    
$ch curl_init('http://money.yandex.ru/'); 
    
curl_setopt($chCURLOPT_USERAGENT'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3'); 
    
curl_setopt($chCURLOPT_COOKIEFILE'./cook.txt');
    
curl_setopt($chCURLOPT_COOKIEJAR'./cook.txt'); 
    
curl_setopt($chCURLOPT_TIMEOUT10); 
    
curl_setopt($chCURLOPT_FOLLOWLOCATION1); 
    
curl_setopt($chCURLOPT_RETURNTRANSFER1); 
    
$res curl_exec($ch); 
    if(
preg_match_all('#<strong>.*</strong>.*</td>#'$res$m))
    
print_r($m);    
}
    


?>
Накидал на скорую руку, проверил, работает.
Цитата:
Array ( [0] => Array ( [0] => Деньги [1] => 5 руб. 36 коп. ) )
 
Ответить с цитированием