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 '数据불합법' ;
종료;
} $sql = "id가 있는 padd에서 삭제($id)";
$result = mysqli_query($connID, $sql);
if ($result) {
echo '删除成功';
} else {
echo '删除失败';
}
?>
index.php如下:
<?php
include_once("connconn.php");
$sql = "에서 * 선택 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">';
while ($row = mysqli_fetch_assoc($result)) {
echo '<tr>';
echo ' <td><input type="checkbox" name="id[]" value="' . $row['id'] . '" /></td>';
echo '<td> ;' . $행['이름'] . '</td>';
에코 '<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>';
} else {
echo '没有数据';
}
mysqli_close($connID);
?>