我用它来收集复选框的值数组。PHP Post CheckBox返回空数组
<form action="example.php" method="post" name="deleteform">
<input type="submit" value="delete"/>
<table>
<?php
foreach ($memArray as $row) {
echo "<tr align=\"center\">
<td><input type=\"checkbox\" value=\"".$row['cus_id']."\" name=\"del[]\" /></td>";
echo "</tr>";
}
?>
</table>
</form
>
如果形式发布,然后做
$delArray = $_POST['del'];
print_r($delArray);
但结果返回数组,但里面什么也没有
我已经改变名称=删除,而不是名称= del [],它工作。但是,当我添加[]返回它返回空阵列
未选中的复选框不会与表单的其余部分一起提交。 – 2012-02-23 05:23:32
检查表单的方法..是那个职位,或者你已经设置它得到..? – 2012-02-23 05:23:43
它是在一个窗体中,我使用post方法。 – JBL 2012-02-23 05:24:59