hoverinc Posted December 16, 2010 Share Posted December 16, 2010 Hello dear guys, I have this code below which is to send SMS to single mobile No, but i am willing to send this message to the whole table of mobiles that i have please help, with thanks in advance <? $url="https://www.GATEWAYSITE"; $login="LOGIN"; $pwd="PSWD"; $mittente="CO"; $numero="$cellulare"; $testo=urlencode($messaggio); $y="login=".$login."&pwd=".$pwd."&testo=".$testo."&numero=".$numero."&mittente =".$mittente; $contents = @file_get_contents($url."?".$y); print $contents; ?> Link to comment https://forums.phpfreaks.com/topic/221852-sms-sender-to-mysql-users/ Share on other sites More sharing options...
trq Posted December 16, 2010 Share Posted December 16, 2010 So execute that code in a while loop which loops through all the records that match your query. Link to comment https://forums.phpfreaks.com/topic/221852-sms-sender-to-mysql-users/#findComment-1148050 Share on other sites More sharing options...
hoverinc Posted December 20, 2010 Author Share Posted December 20, 2010 <?php $link = @mysql_connect('localhost', 'root', '') or die ('Could not connect to mysql'); @mysql_select_db('radius senza lock', $link) or die ('Could not select database'); $sql = "SELECT mobile FROM ias_mobile" ; $result = mysql_query($sql, $link); if (!$result) { echo "DB Error, could not query the database\n"; echo 'MySQL Error: ' . mysql_error(); exit; } while ($row = mysql_fetch_array($result)) { $mobile = $row['mobile']; echo $mobile; echo "<br>"; $sql = "INSERT INTO sms_notify (mobile) VALUES ('" . $mobile . "')"; mysql_query ($sql, $link); } mysql_close($link); ?> Link to comment https://forums.phpfreaks.com/topic/221852-sms-sender-to-mysql-users/#findComment-1149510 Share on other sites More sharing options...
hoverinc Posted December 20, 2010 Author Share Posted December 20, 2010 THIS IS THE WEBGATE OF THE SMS PLEASE HELP NEEDED TO SEND TO MULTIPLE USERS AT ONCE WITH THANKS <? $url="webaddress"; $login="user"; $pwd="psw"; $mittente="company"; $numero="$cellulare"; $testo=urlencode($messaggio); $y="login=".$login."&pwd=".$pwd."&testo=".$testo."&numero=".$numero."&mittente=".$mittente; $contents = @file_get_contents($url."?".$y); print $contents; ?> Link to comment https://forums.phpfreaks.com/topic/221852-sms-sender-to-mysql-users/#findComment-1149522 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.