2016-04-13 140 views
0

下面是我嘗試在網站上登錄的代碼。我不知道什麼不起作用,該網站可能改變了一些東西,我不爲我工作。我不知道可能是什麼。cURL認證問題

$var = file_get_contents("http://www.dauanunt.ro/cont/login"); 

$q = explode("name=\"q\" value=\"",$var); 
$q = explode("\" />",$q[1]); 
$q = $q[0]; 

$ga_bi['a'] = 'login'; 
$ga_bi['q'] = $q; 
$ga_bi['h'] = ''; 
$ga_bi['u'] = '[email protected]'; 
$ga_bi['p'] = 'testing'; 
$ga_bi['r'] = '1'; 

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, 'http://www.dauanunt.ro/cont/login'); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_HEADER, 0); 
curl_setopt($ch, CURLOPT_REFERER, "http://www.dauanunt.ro"); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $ga_bi); 
$result = curl_exec($ch); 
curl_close($ch); 

echo $result; 

回答