<?php mysql_connect("localhost","root",""); mysql_select_db("sms"); ?> <html> <head> <title>Auto Reply</title> <script language="javascript" src="jquery-1.7.2.min.js"></script> <script> $(document).ready(function(){ autoreplay(); }); function autoreplay(){ $.ajax({ url : 'auto_kirim.php', success : function(msg) { $('tr.first').after(msg).fadeIn(300); } }); setTimeout("autoreplay()",10000); } </script> </head> <body> <table> <tr class="first"> <td>Pesan</td> <td>Pengirim</td> <td>Status Kirim</td> </tr> <?php $query = mysql_query("SELECT * FROM inbox WHERE Processed='true'"); while($data = mysql_fetch_object($query)){ ?><tr> <td><?php echo $data->Text; ?></td> <td><?php echo $data->SenderNumber; ?></td> <td><?php echo $data->Processed; ?></td></tr> <?php } ?> </body> </html>
Autoreply.php
<?php mysql_connect("localhost","root",""); mysql_select_db("sms"); $query = mysql_query("SELECT * FROM inbox WHERE Processed='false'"); while($data = mysql_fetch_object($query)){ //Disini letak Parsing Data //Anda bisa tambahkan parsing Data Anda Sendiri $text = "Pesan Anda adalah ".$data->Text; //============================================== //Masukkan pesan ke Table outbox $q2 = mysql_query("INSERT INTO outbox(DestinationNumber, TextDecoded, CreatorID) VALUES ('".$data->SenderNumber."','".$text."','Gammu')"); //Update Pesan Terkirim pada table inbox $q3 = mysql_query("UPDATE inbox SET Processed = 'true' WHERE ID = '".$data->ID."'"); //output berupa row pada table ?> <tr> <td><?php echo $data->Text; ?></td> <td><?php echo $data->SenderNumber; ?></td> <td>true</td> </tr> <?php } ?>
Sumber :
http://onthecomputershare.blogspot.com/2012/06/software-sms-auto-reply-sms-gateway.html
0 ulasan:
Catat Ulasan
Selamat datang ke 0x2013LΣΣT. Sekiranya anda mempunyai persoalan, pandangan, permintaan, bantuan, cadangan dan sebagainya. Tinggalkan pesanan anda ke dalam kotak komen. Terima kasih !
- http://0x2013.blogspot.com -