$data ='username=' .$username . '&api_password=' . $hash . '&sender=' . $sender . "&to=" . $numbers . "&message=" . $message . "&priority=11" ;
// Send the GET request with cURL
$ch = curl_init('http://****************' . $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
// Process your response here
echo $response;
I can send sms using this php code from localhost. But when i upload this code to server I cannot get a respose from the url.
$data = array('username' => $username, 'api_password' => $hash, "sender" => $sender, 'to' => $numbers, "message" => $message, "priority" => 11);
// Send the POST request with cURL
$ch = curl_init('http://**********************');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
// Process your response here
echo $response;
I also tried this method. I can send sms from my localhost. But no response when i upload this on my live server. is there any other method to send sms in php? Please Help !!!