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
https://forums.phpfreaks.com/topic/110601-solved-bulk-sms/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.