|
is this the right way to use curl:
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'$xurl');
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2) ;
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1) ;
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
if (empty($buffer))
{
print "Sorry - no content.<p>";
}
else
{
echo "<h1>HERE IS CONTENT:</h1><hr> $buffer";
}
//----------------
the issue is even if i pass valid url still i got the negative answer...
|