在具有限制的Php中重复过程

时间:2013-06-20 14:09:56

标签: php sql

我想制作批量短信服务。

我有一个Api,我们必须提供收件人号码为92312xxxxx

 ETC 12 Numeric Characters

我想制作批量短信服务,只需点击一下即可发送:

Recipient Parameters
92312xxxxxxx,92323xxxxxxx,923xxxxxxxxx, .......... up to End

我已经深入研究但完全困惑如何做到这一点?

其他收件人号码也有一些限制参数

Restrictions

Parameter Error 1 = RECIPIENT Can't be Greater than 12 or Less Than 12

Parameter Error 2 = Recipient First Third Characters Are 923

如果发生任何错误:

*跳过错误的号码并转到下一个收件人
 *逐个减少一列(平衡)并排从SQL表

如果在处理过程中Sql列值达到零则停止整个过程和回声:您已使用了您的信用

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

0 个答案:

没有答案