sql - Rpeat Process In Php With Restrictions

967

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); 
?>

People are also looking for solutions to the problem: php - Codeigniter Form Validation - Custom callback with regex that allows accents

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.