$ch = curl_init();
$varpost = '&res=1'; // Initiate cURL
$url = 'http://www.testxcvt.com/';// is 404 page
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $varpost);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec ($ch); // Execute
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if(curl_errno($ch))
{
echo 'error:' . curl_error($ch);
}
curl_close ($ch); // Close cURL handle
PFA代碼,我有。當我顯示$代碼時,我得到200。在我的瀏覽器中,我收到了404頁的廣告。我不確定什麼是共享404頁的200。curl返回200找不到頁面
請幫忙
是http://www.testxcvt.com/您試圖獲得的實際頁面?因爲我沒有看到任何404頁面。該頁面不存在或尚未激活。 – jakob
沒有它的一個randon地址我試過了,它給了我404 –