`
chengxianju
  • 浏览: 247872 次
  • 性别: Icon_minigender_1
  • 来自: 合肥
社区版块
存档分类
最新评论

checkbox传值

阅读更多

<html>
<head>
<body>
<form action="result.php" method="POST">
<input type="checkbox" name="year[]" value="1">1 &nbsp;&nbsp;
<input type="checkbox" name="year[]" value="2">2 &nbsp;&nbsp;
<input type="checkbox" name="year[]" value="3">3 <br>
<input type="submit" name="btn_ok" value="ok">
</form>
</body>
</head>
</html>


result.php代码:

<?php
foreach ($_POST['year'] as $item)
{
echo $item." <br>";
}
?> 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics