i have this problem. I neent to cURL an api link given to me by my bulksms gateway for use in the site i'm building. The link is smsplus4.routesms.com . This link does not work if you access it with the www or http://www prefixes. Now i have the curl function
function curl_get_contents($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$api = "smsplus4.routesms.com";
curl_get_contents($api);
which did not work because of the missing http://www prefix. Pls what do i do? how do i get the cURL to work for me without the http://www prefix? Thanks in advance.
Running exactly the code above seems to work for me.