Zrobiłem sobie coś takiego:
<html><head> <meta http-equiv=\"Content Type\" Content=\"text/html; charset=iso-8859-2\"> </head><body align=\"center\" bgcolor=\"#8c9ead\"> <?php $user = 'root'; $pass = ''; $host = 'localhost'; $dbname = 'iptables'; ?> <form method=POST> <table align=\"center\" cellspacing=\"1\" cellpadding=\"1\" border=\"0\" bgcolor=\"#\"> <tr> <td align=\"center\" height=\"30\" width=\"160\" bgcolor=\"#dee4e9\"> Adres IP </td> <td align=\"center\" heigh=\"30\" width=\"160\" bgcolor=\"#dee4e9\"> Docelowe IP </td> <td align=\"center\" height=\"30\" width=\"100\" bgcolor=\"#dee4e9\"> Z portu </td> <td align=\"center\" height=\"30\" width=\"100\" bgcolor=\"#dee4e9\"> Do portu </td> <td align=\"center\" height=\"30\" width=\"120\" bgcolor=\"#dee4e9\"> Protokół </td> <td align=\"center\" height=\"30\" width=\"100\" bgcolor=\"#dee4e9\"> Działanie </td> <td align=\"center\" height=\"30\" width=\"120\" bgcolor=\"#dee4e9\"> Edytuj regułę </td> <td align=\"center\" height=\"30\" width=\"120\" bgcolor=\"#dee4e9\"> Usuń regułę </td> </tr> </table> <br /> <?php $conn_id = mysql_connect($host, $user, $pass) or die('Nie można się połączyć z bazą danych $dbname'); { ?> <table align=\"center\" cellspacing=\"1\" cellpadding=\"1\" border=\"0\" bgcolor=\"#\"> <tr> <td align=\"center\" height=\"30\" width=\"160\" bgcolor=\"#dee4e9\"> </td> <td align=\"center\" heigh=\"30\" width=\"160\" bgcolor=\"#dee4e9\"> </td> <td align=\"center\" height=\"30\" width=\"100\" bgcolor=\"#dee4e9\"> </td> <td align=\"center\" height=\"30\" width=\"100\" bgcolor=\"#dee4e9\"> </td> <td align=\"center\" height=\"30\" width=\"120\" bgcolor=\"#dee4e9\"> </td> <td align=\"center\" height=\"30\" width=\"100\" bgcolor=\"#dee4e9\"> </td> <td align=\"center\" height=\"30\" width=\"120\" bgcolor=\"#dee4e9\"> <input type=\"submit\" value=\"Edytuj regułę\" name=\"edit_rule\"> </td> <td align=\"center\" height=\"30\" width=\"120\" bgcolor=\"#dee4e9\"> <input type=\"submit\" value=\"Usuń regułę\" name=\"delete_rule\"> <?php if($delete_rule) { } ?> </td> </tr> </table> <?php } ?> <br /> <table align=\"center\" cellspacing=\"1\" cellpadding=\"5\" border=\"0\" bgcolor=\"#\"> <tr> <td width=\"500\" height=\"\" bgcolor=\"#dee0e3\"> <li><b>Adres IP:</b></li> <blockquote> Określa adres IP z którego modyfikowany ma zostać ruch sieciowy. Adres IP m że zostać podany w formacie IPv4 oraz IPv6 </blockquote> <li><b>Docelowe IP:</b></li> <blockquote> Określa adres IP do którego modyfikowany ma zostać ruch sieciowy. Wówczas d myślnym adresem ip jest 127.0.0.1. Adres IP może zostać podany w formacie IPv4 o az IPv6 </blockquote> <li><b>Z portu:</b></li> <blockquote> Określa na którym porcie modulowany ma być ruch sieciowy wychodzący z <i>localhost</i>. Jeśli nie zostaną podane wartości <b>Adres IP</b> oraz <b>Docelowe IP</b> wówczas wykorzystane zostaną wartości domyślne, czyli: <i>localhost -> gateway</i>. </blockquote> <li><b>Do portu:</b></li> <blockquote> Określa modulowanie ruchu sieciowego wychodzącego z portu wybranego w \"<b>Z Portu</b>\" do portu określanego w \"<b>Do Portu</b>\". Jeśli w polu <b>Z portu</b> nie określono żadnego portu TCP/IP, zostają wykorzystane wartości domyślne, czyli: <i>21, 22, 80, 110</i>. </blockquote> </td> </tr> </table> </form> </body></html>
Teraz mam problem:
Wyciągam informacje zapisane w tabeli:
<?php $conn_id = mysql_connect($host, $user, $pass) or die('Nie można się połączyć z bazą danych $dbname'); { ?>
Dalej wyświetlam je w tabelkach:
<td align=\"center\" height=\"30\" width=\"160\" bgcolor=\"#dee4e9\"> </td>
I Teraz chcę usunąc tylko jeden, poszczególny rekord>
Zrobiłem tak:
<td align=\"center\" height=\"30\" width=\"120\" bgcolor=\"#dee4e9\"> <input type=\"submit\" value=\"Usuń regułę\" name=\"delete_rule\"> <?php if($delete_rule) { } ?> </td>
To niestety usuwa mi całą zawartość tabeli.... ;(
Proszę o pomoc...