如何进行checkbox的选中判断
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><?php
while($row=mysql_fetch_array($result)){
?>
<tr>
<td width="10" scope="col" bgcolor="#E0EEE0"><input type="checkbox" name="shanchu[]" /></td>
<td>.....</td>
<td>.....</td>
<td>还有很多数据,省略</td>
</tr>
<?php
include('conn.php');
$delete=$_POST['shanchu'];
foreach($delete as $k=>$v){        
$sql="delete  from record";         //这块应该怎么写?  能不能只判断checkbox选中的情况而 不看其他的数据?
$result=mysql_query($sql,$con);
}
    if($result!=""){
        echo "数据删除成功";
        echo "<br>";
        echo "正在返回删除页面,跳转中...";
        echo "<meta http-equiv='refresh' content='2;url=shanchu.php'>";  
    }
    else {
        echo "数据输入错误";
        echo "<br>";
        echo mysql_error();
    }
?>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号