I am trying to send SMS after the leads submission, but somewhere I am doing mistake, here is my code:
if($after_query_is_insered) {
$authKey = "xxxxxxxxxxxxxxxxxxxxxxx";
$mobileNumber = $mobile;
$message = "Thank you";
$senderId = "Umar";
$route = "4";
$country = "0";
$postData = array(
'authkey' => $authKey,
'mobiles' => '79822xxxx',
'message' => $message,
'sender' => $senderId,
'route' => $route,
'country' => $country
);
$url="http://bulksmsc.com/api/sendhttp.php";
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postData
//,CURLOPT_FOLLOWLOCATION => true
));
//Ignore SSL certificate verification
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$output = curl_exec($ch);
if(curl_errno($ch))
{
echo 'error:' . curl_error($ch);
}
curl_close($ch);
// echo $output; die;
}
This is my code where I am checking whether the lead is submitted to database, if it is submitted then I am trying to send the message, and I have to remain on the same page, so that other important queries run. Normally when I directly put my api into browser and send the message, it works. But here I can't use anchor to directly set the message as I will be redirected to another page. I am on Localhost. It is not working out. I have also tried to change the port to 8089, but it failed. Is there any way to do this?