delete.php:
<?php
include_once("connconn.php");
if (is_array($_POST['id'])) {
$id = join(',', $_POST[ 'id']);
} elseif (is_numeric($_GET['id'])) {
$id = (int) $_GET['id'];
} else {
echo '数据不合法' ;
keluar;
} $sql = "padam dari padd tempat id masuk($id)";
$result = mysqli_query($connID, $sql);
if ($result) {
echo '删除成功';
} yang lain {
echo '删除失败';
}
?>
index.php如下:
<?php
include_once("qnncode_once("); padd order by id desc";
$result = mysqli_query($connID, $sql);
if ($result && mysqli_num_rows($result)) {
echo '<form action="delete.php" method="post ">';
echo '<table width="800" border="1">';
manakala ($row = mysqli_fetch_assoc($result)) {
echo '< tr> cho '
echo ' <td><input type="checkbox" name="id[]" value="' . $row['id'] . '" /></td>';
echo '<td> ;' . $row['nama'] . '</td>';
gema '<td>' . long2ip($row['pad']) . '</td>';
echo '<td><a href="edit.php?id=' . $row['id'] . '">编辑用户</a>< /td>';
echo '<td><a href="delete.php?id=' . $row['id'] . '">删除用户</a></td> ';
echo '</tr>';
}
echo '</table>';
echo '<input type="submit" value="删除" /> ; echo '> ; /form>';
} lain {
gema '没有数据';
}
mysqli_close($connID);
?>