Creating a Delete php / mysql form

advertisements

When a was creating a little code in php/mysql I wanted to know how to build a php form to delete an item from database.

The first code is index.php the goal of the script is to gather information about the visitor's of my website because users who want to deface my website.

<?php

    $getting_ips = mysql_query("SELECT * FROM ip_capture_module");
    if ($getting_ips) {
        while ($row = mysql_fetch_array($getting_ips)) {
    ?>
    <tr>
        <td><?php echo $row['id']; ?></td>
        <td><strong><? echo $row['country']; ?></strong></td>
                                <td><?php echo $row['browser']; ?></td>

        <td><a href="http://<?php echo $row['ipaddr']; ?>"><?php echo $row['ipaddr']; ?></a></td>
                    <td><?php echo $row['method']; ?></td>
        <td><strong><?php echo $row['sploit'];  ?></strong></td>
        <td><?php echo $row['date']; ?></td>
        <td><a href="delete.php">delete</a></td>
    </tr>

    <?php
// The Second Code is capture.php
#------------------------------------------------------------------------------------------
   ...
        ....
 mysql_query("INSERT INTO ip_capture_module(country,browser,ipaddr,method,date) VALUES(
            '$country_name',
            '$browser',
            '$ip',
            '$method',
            CURRENT_TIMESTAMP())") or die ("<br>Error in inserting in IP: ".mysql_error()."<br>");


  DELETE FROM `table` WHERE `some_row`='row_value'

This is the best i can do, since you haven't given enought informations to help you more