sql - Rpeat Process In Php With Restrictions
I want to make Bulk Sms Service.
I Have an Api in which we have to provide the Recipient Numbers As 92312xxxxx
ETC 12 Numeric Characters
I want to make bulk SMS Service and be able to Send it in one click like :
Recipient Parameters 92312xxxxxxx,92323xxxxxxx,923xxxxxxxxx, .......... up to End
I Have Searched Deeply But Totally Puzzled How to Do it ??
Further Recipient Numbers Have Some Restrictions Too That Are Parameters
Restrictions Parameter Error 1 = RECIPIENT Can't be Greater than 12 or Less Than 12 Parameter Error 2 = Recipient First Third Characters Are 923
If And Any Error Occurs :
*Skip the Wrong Number And GO to Next Recipient
*Decrease A Column One BY one (Balance) side by side From SQL table
IF During Process Sql Column value Reached On Zero Then Stop The Whole Process and Echo : You have used Your Credit
<?php $mysender2 = "Not Use"; $myrecepient2 = "923126812536"; $msg = "The Message That Will Go Again Again In Curl Untill Process Complete or SQL Column Reached Zero"; $url = "https://rest.nexmo.com/sms/json?" . "api_key=".$api_key. "&" . "api_secret=" .$api_secret . "&" . "from=" . urlencode($mysender2) . "&" . "to=" . urlencode($myrecepient2) . "&" . "text=" .urlencode($msg); $c = curl_init($url); // Use SSL curl_setopt($c, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($c, CURLOPT_RETURNTRANSFER, TRUE); $html = curl_exec($c); ?>