复选框有一个统一的名子
<input type="checkbox" name=id[] value=1>
<input type="checkbox" name=id[] value=2>
<input type="checkbox" name=id[] value=3>
<input type="checkbox" name=id[] value=4>
和般为这样的,然后提交你的表单,也就是点删除
你就可以接收到$id数组了,然后删,就可以了
<input type="checkbox" name=id[] value=1>
<input type="checkbox" name=id[] value=2>
<input type="checkbox" name=id[] value=3>
<input type="checkbox" name=id[] value=4>
和般为这样的,然后提交你的表单,也就是点删除
你就可以接收到$id数组了,然后删,就可以了
像这样:
<select name=check[]>
<option value=1>!!!</option>
<option value=2>!!!</option>
..
..
..<option value=3>!!!</option></select>然后下一页进行判断:
$count=count(check);
for($i=0;$i<$count;$i++)
{
delete.......
}
<input type="checkbox" name=id[] value=1>
<input type="checkbox" name=id[] value=2>
<input type="checkbox" name=id[] value=3>
<input type="checkbox" name=id[] value=4>
1.php
<?
require("funcs.php");
$mylink=dbconnect();
$sql="select * from menu order by id desc";
$result=mysql_query($sql);
while($obj=mysql_fetch_object($result))
{
?> <FORM NAME="form1" METHOD="post" ACTION="2.php"><TABLE WIDTH="96%" BORDER="0"><TR><TD><INPUT TYPE="checkbox" VALUE="<?echo $obj->id?>" NAME="id[]"><?echo $obj->name?></TD></TR></TABLE><?}?>
<INPUT TYPE="submit" NAME="Submit" VALUE="提交">
</FORM>2.php
<?
require("funcs.php");
$mylink=dbconnect();
$sql="delete from menu where id='$id'";
$result=mysql_query($sql);
if($result) echo "ok";
else echo "no";
?>