Langsung saja, kopikan script berikut, script berikut digunakan untuk menampilkan data sms yang ada di tabel outbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// koneksi ke database | |
$hostname_config = "localhost"; | |
$database_config = "ok"; | |
$username_config = "root"; | |
$password_config = "root"; | |
$config = mysql_pconnect($hostname_config, $username_config, $password_config) or trigger_error(mysql_error(),E_USER_ERROR); | |
mysql_select_db($database_config, $config); | |
// tampilkan database | |
echo"<a href='del.php?id=semua'><b>hapus semua</b></a><p>"; | |
echo"<center><table width=100% border='1'> | |
<tr> | |
<th width='20%' align='left'>Tujuan</th> | |
<th width='45%' align='left'>Isi Pesan</th> | |
<th width='20%' align='left'>Waktu Pengiriman</th> | |
<th width='20%' align='left'>hapus</th> | |
</tr> | |
"; | |
$outbox = mysql_query("SELECT * FROM outbox ORDER BY ID DESC"); | |
while($toutbox=mysql_fetch_array($outbox)) | |
{ | |
echo " | |
<tr> | |
<td align='left'>$toutbox[DestinationNumber]</td> | |
<td class='baca1' align='left'>$toutbox[TextDecoded]</td> | |
<td class='baca1' align='left'>$toutbox[SendingDateTime]</td> | |
<td class='baca1' align='left'><a href='del.php?id=satu&no=$toutbox[ID]'>hapus</a></td> | |
</tr> | |
"; | |
} | |
?> |
Kopikan juga untuk script proses menghapusnya
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// koneksi ke database | |
$hostname_config = "localhost"; | |
$database_config = "ok"; | |
$username_config = "root"; | |
$password_config = "root"; | |
$config = mysql_pconnect($hostname_config, $username_config, $password_config) or trigger_error(mysql_error(),E_USER_ERROR); | |
mysql_select_db($database_config, $config); | |
if($id==semua) | |
{ | |
$command = mysql_query("DELETE FROM outbox"); | |
header("Location:outbox.php"); | |
} | |
if($id==satu) | |
{ | |
$command = mysql_query("DELETE FROM outbox where ID='$no'"); | |
header("Location:outbox.php"); | |
} | |
?> |
0 komentar:
Posting Komentar