我試圖打開一個https url,但它不工作。它適用於其他https網站,但爲此它不起作用。我不知道它爲什麼會這樣發生。以下是我寫的代碼。 請幫忙。Url不使用php curl
<?php
error_reporting(E_ALL);
$url = "https://sgate.bmwgroup.com/login_common.fcc";
$ch = curl_init($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 200);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,1);
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,TRUE);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)");
$curl_scraped_page= curl_exec($ch);
if(!$curl_scraped_page)
{
echo "first learn";
}
if(curl_errno($ch)) {
echo 'Curl error: ' . curl_error($ch);
}
echo $curl_scraped_page;
curl_close($ch);
?>
什麼錯誤訊息您reciving? – chill0r 2014-10-03 12:01:10
澄清什麼是「不工作」 – hindmost 2014-10-03 12:02:27
打開一個空白頁面。 – user2396181 2014-10-03 12:05:25