2
嘿,我試圖捲曲「https://www.libertyreserve.com/captcha.jpg」
所以我試圖捲曲它,但結果卻是「1×1」的Gif產品圖
然後我reialized,該網站希望從登錄一個cookie頁面顯示有效的驗證碼 我使用的功能錯誤捲曲功能
$file['cookie'] = "cookie.txt";
function cURL_Page($url='',$var=''){
global $file;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT,20);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31');
curl_setopt($curl, CURLOPT_REFERER, "http://www.libertyreserve.com/en/login");
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
if($var) {
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $var);
}
curl_setopt($curl, CURLOPT_COOKIE,$file['cookie']);
curl_setopt($curl, CURLOPT_COOKIEFILE,$file['cookie']);
curl_setopt($curl, CURLOPT_COOKIEJAR,$file['cookie']);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 3);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
$result = curl_exec($curl);
curl_close($curl);
return $result;
}
然後我捲曲登錄頁面
$LoginPage = cURL_Page("https://www.libertyreserve.com/en/login");
然後捲曲在PIC,並把報頭和打印
$ImageCode = cURL_Page("https://www.libertyreserve.com/captcha.jpg");
header("Content-Type: image/gif");
echo $ImageCode;
,但結果仍然是「1×1」 BCZ捲曲功能不;噸保存的cookies
PS:網站的響應與「內容類型:image/GIF」爲我把它放在頭