Home >Backend Development >PHP Tutorial > 批量剔除文章ID。

批量剔除文章ID。

WBOY
WBOYOriginal
2016-06-13 12:46:261099browse

批量删除文章ID。。。。?

<br />
(list.php): <br />
<form action="del.php" method="post"> <br />
<?php <br />
$sql="select * from news where leibie='$leibieming'";<br />
$r=$mysqli->query($sql); <br />
while($rs=$r->fetch_assoc()){ <br />
?> <br />
<input type="checkbox" value="<?=$rs[id]?>" /><?=$rs[title]?> <br />
<?php <br />
} <br />
?> <br />
<input type="button" value="删除""><br />
</form> <br />
2、处理惩罚页面(del.php): <br />
<?php <br />
if($del_id!=""){ <br />
$del_num=count($del_id); <br />
for($i=0;$i<$del_num;$i++){ <br />
$mysqli->query("delete news.......");<br />
} <br />
echo("<script type='text/javascript'>alert('删除乐成!');history.back();</script>"); <br />
}else{ <br />
echo("<script type='text/javascript'>alert('请先选择项目!');history.back();</script>"); <br />
} <br />
?> 


在网上抄回来的,del_id 这个变量是怎么传递的?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn