Jump to content

[SOLVED] bulk SMS


phpnewbie112

Recommended Posts

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

}

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.