我正在尝试使用 POST 方法从输入表单(复选框)传递多个值,但只有一个值被转储,无论检查了多少个复选框。我做错了什么?
var_dump($_POST);
结果是:array(2) { ["pal_num"]=> string(1) "2" ["post"]=> string(3) "Go!" }
代码:
<?php
$l = $_POST['LT'];
$pals = '';
$r = mysql_query("SELECT DISTINCT pal_num FROM pl_tab WHERE lt_num='$l'");
while($row = mysql_fetch_assoc($r))
{
$pals .= '<input type="checkbox" name="pal_num" value="'.$row['pal_num'].'">'.$row['pal_num'].'<br>';
}
if($pal == '')
echo '';
else
echo '<form name="get_pal" action="post.php" method="POST">';
echo $pals;
echo '<input type="submit" name="post" value="Go!">';
echo '</form>';
?>