P粉9767371012023-08-23 09:35:07
Use javascript
<input name="Submit2" type="button" class="button" onclick="javascript:location.href='delete.php?id=<?php echo $your_id;?>';" value="« 返回" />
In delete.php
$id=$_GET['id'];
And put $id into your sql statement.
P粉2897750432023-08-23 09:15:04
You must pass a variable in the delete link. You have to pass <?php echo $contact['name']; ?>
(name
value) in a hidden field or pass this value to URL
:
with
<td class="contact-delete"> <form action='delete.php' method="post"> <input type="hidden" name="name" value=""> <input type="submit" name="submit" value="Delete"> </form> </td>
use
<td class="contact-delete"> <form action='delete.php?name="<?php echo $contact['name']; ?>"' method="post"> <input type="hidden" name="name" value="<?php echo $contact['name']; ?>"> <input type="submit" name="submit" value="Delete"> </form> </td>