我一直在使用curl的脚本,它工作正常,但从最后一天起它无法正常工作,我来看看我使用的网站首先在http上,现在已经变成https所以我将http更改为https,但没有成功,所以如果你有人可以请检查这段代码它出了什么问题?
$userSearch = array();
$loginURL = "https://www.infamousgangsters.com/checkuser.php";
$referer = "https://www.infamousgangsters.com/index.php";
$agent = "OrgyBot (Checking list of users to see if they are dead)";
$postFields = array
(
"username" => "d34dch3ck",
"password" => "d34dch3ck93",
"sublogin" => "+Login+"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $loginURL);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookiejar');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookiejar');
ob_start();
$output = curl_exec($ch);
ob_end_clean();
curl_close($ch);
unset($ch);
echo $output;
答案 0 :(得分:0)
https就不那么简单了。您需要将其配置为接受证书。在此处阅读更多内容:http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/