我有一個捲曲問題。我需要從我的個人資料和網站提取數據(帳戶的有效性)。問題是缺乏記錄。通過php/curl登錄時出現問題
$login = "tinware2";
$password = "passtest";
$ckfile = tempnam("./cookies", "goldvod.txt");
$page_login = "http://goldvod.tv/login.html";
$page_download = "http://goldvod.tv/profil.html";
$post_data = "?login=$login&pass=$password";
$agent = "Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3";
$headers = array();
$headers[] = 'GET /login.html HTTP/1.1';
$headers[] = 'Host: goldvod.tv';
$headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8';
$headers[] = 'Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4';
$headers[] = 'Referer: http://goldvod.tv/login.html';
$headers[] = 'Upgrade-Insecure-Requests: 1';
$headers[] = 'User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36';
$connect = curl_init();
curl_setopt($connect, CURLOPT_URL, $page_login);
curl_setopt($connect, CURLOPT_COOKIESESSION, 1);
curl_setopt($connect, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt($connect, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt($connect, CURLOPT_TIMEOUT, 40);
curl_setopt($connect, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($connect, CURLOPT_HEADER, 0);
curl_setopt($connect, CURLOPT_HTTPHEADER, $headers);
curl_setopt($connect, CURLOPT_USERAGENT, $agent);
curl_setopt($connect, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($connect, CURLOPT_POST, 1);
curl_setopt($connect, CURLOPT_POSTFIELDS, $post_data);
curl_exec($connect);
curl_setopt($connect, CURLOPT_URL, $page_download);
$page = curl_exec($connect);
curl_close($connect);
echo $page;
該腳本沒有記錄帳號。請幫忙。
不是一個好主意後的憑證......(用戶名/密碼) - 你應該刪除它們...... – urban
你能分享您收到錯誤消息? – mba12
@urban它可能是一個無特權的測試帳戶,沒有安全意義,沒有問題共享 – hanshenrik