时间:2021-07-01 10:21:17 帮助过:9人阅读
$ID_Dele= implode(",",$_POST['ID_Dele']);
$SQL="delete from `doing` where id in ($ID_Dele)";
脚本之家提供测试代码:
代码如下:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<?php
if ($_POST["action"]="doing"){
$del_id=$_POST["ID_Dele"];
$ID_Dele= implode(",",$_POST['ID_Dele']);
echo "合并后:".$ID_Dele."<br />合并前:";
if($del_id!=""){
$del_num=count($del_id);
for($i=0;$i<$del_num;$i++){
echo $del_id[$i];
}
}
}else{
echo "请提交";
}
?>
<form action="?action=doing" method="post">
<input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="第1个"/>第1个
<input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="第2个"/>第2个
<input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="第3个"/>第3个
<input name="ID_Dele[]" type="checkbox" id="ID_Dele[]" value="第4个"/>第4个
<input type="submit"/>
</form>