$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 the code that i have. i get 200 when i display $code. in my browser i get an advertisement for 404 pages. i am not sure what is the reson to get 200 for 404 page.
Please help