I am using PHP's Curl functions to post data to the web server from my local machine. the code that i am using,
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_RETURNTRANSFER,true);
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, $data);
$result=curl_exec ($c);
if(curl_exec($c) === false)
{
echo "ok";
}
else
{
echo "error";
}
curl_close ($c);
this is a basic code that i am using, but i am not able to catch any error..like if in case of 404,500 or network failure how will i get to know that data was not posted to server.