Rumah > Soal Jawab > teks badan
P粉9767371012023-08-23 09:35:07
Gunakan javascript
<input name="Submit2" type="button" class="button" onclick="javascript:location.href='delete.php?id=<?php echo $your_id;?>';" value="« 返回" />
Dalam delete.php
$id=$_GET['id'];
dan letakkan $id dalam pernyataan sql anda.
P粉2897750432023-08-23 09:15:04
Anda perlu lulus pembolehubah dalam pautan padam. Anda perlu lulus <?php echo $contact['name']; ?>
(name
值)或将此值传递给URL
dalam medan tersembunyi:
digantikan dengan
<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>
Gunakan
<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>