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
Code: Select all
<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
Code: Select all
<?
@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();
}
?>