I want to execute a url for which i am using curl.
I have following curl script:
$messageUrl = "http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?username=myusername&password=pass&sendername=sender&mobileno=mob&message=hi";
//$content=file_get_contents($messageURl);
$ch = curl_init($messageUrl);
$fp = fopen("message.txt", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
When i execute this script on my local server it runs fine that is the sms is sent to the user and message is successfully written to the message.txt file.
But when i upload it on the server (hostgator). It does not work.
I had a talk with hosting provider. Earlier curl was not enabled but was enabled after the conversation. Even then the above example does not run.
I tried to change the above code by calling the simple url: http://google.com. It executes properly on the server with some text written in the message.txt file .
I fail to understand the reason behind this.