Hi there kegham,
First off welcome to the forum! [
webmasterworld.com ]
your code:
You realise you are trusting the user to enter the phone number correctly & to only enter digits? Unless there is some form of sanitising & content checking that you perform somewhere else...
Personally I don't think as you need a while, you may only need a for loop:-
(I tweeked your code a little too ;))
<?php
$values = explode("\n", $_POST['GSM']); // separating mobiles with line carriage
$header = $_POST['userID']; // Posting sms header.
$text = urlencode($_POST['smstext']); // URLencoding the text.
//count array
$counted = count($values);//do the count outside the loop - less intensive on memory
for($i = 0; $i<$counted; $i++)
{
//do loop - this will only do the iterations according to the number of records in array
$url = "http://www.domain.com/sms.php/?UserId=myuser&txtPassword=mypass&GSM=$values[$i]&Header=$header&Text=$text&Send=1";
$ret = file($url); // Broadcast the sms
}
?>
Other than that, not too sure how this little piece of code operates as I haven't messed with sms stuff before. I just tried to simplify things and hopefully get the loop working...
Hope that gives you an alternative way to look at things anyway :)
Cheers,
MRb