现在的位置: 首页 > 综合 > 正文

php取得checkbox值

2012年11月06日 ⁄ 综合 ⁄ 共 333字 ⁄ 字号 评论关闭
<?php
foreach ($_POST['haha'] as $item)
{
echo $item."<br>";
}
?>
<html>
<head>
<body>
<form action="" method="POST">
<input type="checkbox" name="haha[]" value="1">1 &nbsp;&nbsp;
<input type="checkbox" name="haha[]" value="2">2 &nbsp;&nbsp;
<input type="checkbox" name="haha[]" value="3">3 <br>
<input type="submit" name="btn" value="ok">
</form>
</body>
</head>
</html>

抱歉!评论已关闭.