I am trying to use a sms gateway app for android called SMSGateway with a http header request using curl as below;
$curl_handle=curl_init();
curl_setopt($curl_handle, CURLOPT_URL,"http://192.168.1.2:9090/sendsms?phone=$phone&text=$message1&password=xxxxxxxx");
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 10000);
curl_setopt($curl_handle, CURLOPT_TIMEOUT,50000);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:36.0) Gecko/20100101 Firefox/36.0');
$query = curl_exec($curl_handle);
if($query){echo "Message Sent to $phone !<br>";}else{echo "Message Not Sent to $phone !<br>";echo 'Curl error: ' . curl_error($curl_handle)."<br>";}
curl_close($curl_handle);
This works perfectly fine on my local system but it gets timed out when executing from server...
I need to know what is wrong...is it a curl issue ? should i use file_get_contents ? Actually I did try file_get_contents...did not work too..