phpnewbie112 Posted June 17, 2008 Share Posted June 17, 2008 Hello, I am using a gateway similar to clickatell, I am using a simple code where I can send an sms successfuly with good error results. I have a small question, the gateway allow bulk sms by simply adding comma seperated numbers for ex. 123456,789780,123987 with the given code I am using, when I input the 2nd number it is not working, could you pls advice how can I loop it in a way to send the sms to each number while giving failure error for any failed number. sms.html <form method="POST" action="sms.php"> <table border="0" width="100%" id="table1"> <tr> <td width="67">From:</td> <td><select size="1" name="from"> <option value="Sender1">Sender1</option> <option value="Sender2">Sender2</option> </select> </td> </tr> <tr> <td width="67">To:</td> <td><input type="text" name="to" size="20"> </td> </tr> <tr> <td width="67"> </td> <td> </td> </tr> <tr> <td width="67"> </td> <td> </td> </tr> <tr> <td colspan="2"><textarea rows="6" name="text" cols="31"></textarea></td> </tr> </table> <table border="0" width="100%" id="table2"> <tr> <td colspan="2"> </td> </tr> <tr> <td width="67"> </td> <td> </td> </tr> </table> <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p> </form> ____________________________ send.php <? @import_request_variables("gpc"); $user = "x"; $password = "y"; $baseurl ="http://siteurl"; $url = "$baseurl/clientsapi.php?username=$user&password=$password&action=sendsms&from=$from&to=$to&text=$text"; if ( (!empty($from)) && (!empty($to)) && (!empty($text)) ) { $ret = file($url); $send = split(":",$ret[0]); //echo $send[1]; if ($send[0] == "OK") { echo "Success: ". $send[1]; } else { echo "Failure: ". $send[1]; } exit(); } ?> Quote Link to comment Share on other sites More sharing options...
phpnewbie112 Posted June 19, 2008 Author Share Posted June 19, 2008 I used another solution for this issue. thanks anyway Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.