Use the hidden field in the form.
<input type="hidden" name="id" value="<?php echo $id ?>">
You must also start a new form for each new line.
for ($i = 0; $i < $row_count; $i++) { $id = mysql_result ($result, $i, "id"); $path = mysql_result ($result, $i, "path"); $expiration = mysql_result ($result, $i, "expires"); ?> <tr> <td width="60%"> <?php echo $path; ?> </td> <td> <?php echo $expiration; ?> </td> <td> <form method="POST" action="?"> <input type="hidden" name="id" value="<?php echo $id ?>"> <input type="submit" value="Delete Expiration" /> </form> </td> </tr> <?php } ?>
source share