Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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://182.70.76.188: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 !
";}else{echo "Message Not Sent to $phone !
";echo 'Curl error: ' . curl_error($curl_handle)."
";}
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..


Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900