如何不用javascript如何获取多选框的 多个值 $post ???我知道是$_post['']获取但是我要获取的是表单 多选框多个值啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <form id="form1" name="form1" method="post" action=""> <label> <input type="checkbox" name="checkbox" value="game" /> 游戏 <input name="checkbox" type="checkbox" id="checkbox" value="movie" /> 电影 <input name="checkbox" type="checkbox" id="checkbox" value="music" /> 音乐</label> <input type="submit" name="Submit" value="提交" /></form><?phpif ($_POST['checkbox']!=""){$box=$_POST['checkbox'];echo $box;}?> 用数组来传递:<input type="checkbox" name="Name[]" value="Value_1" />...<input type="checkbox" name="Name[]" value="Value_n" />$chk = $_POST["Name"]; //$chk是一个数组 <?phpif ($_POST['checkbox']!=""){ $box=$_POST['checkbox'];foreach ($box as $value){ echo $value; }}?>是这样吗 出错了啊 <form id="form1" name="form1" method="post" action=""> <label> <input type="checkbox" name="checkbox[]" value="game" /> 游戏 <input name="checkbox[]" type="checkbox" id="checkbox" value="movie" /> 电影 <input name="checkbox[]" type="checkbox" id="checkbox" value="music" /> 音乐 </label> <input type="submit" name="Submit" value="提交" /> </form> <form id= "form1 " name= "form1 " method= "post " action= " "> <label> <input type= "checkbox " name= "checkbox[] " value= "game " /> 游戏 <input name= "checkbox[] " type= "checkbox " id= "checkbox " value= "movie " /> 电影 <input name= "checkbox[] " type= "checkbox " id= "checkbox " value= "music " /> 音乐 </label> <input type= "submit " name= "Submit " value= "提交 " /> </form> <form id="form1" name="form1" method="post" action=""> <label> <input type="checkbox" name="checkbox[0]" value="game" /> 游戏 <input name="checkbox[1]" type="checkbox" id="checkbox" value="movie" /> 电影 <input name="checkbox[2]" type="checkbox" id="checkbox" value="music" /> 音乐</label> <input type="submit" name="Submit" value="提交" /></form><?php //获取复选框多个值if ($_POST['checkbox']!=""){ $box=$_POST['checkbox'];foreach ($box as $key=>$value){ echo $key,$value; }}?>谢谢 搞定了!!! 用数组,设置复选框的名字为name[] 菜鸟求教,如何将验证码的验证跟帐号密码加到一块去 缩略图总是失真,拿他没辙 sql语句的效率问题 求解 Database error: cannot use database test-cc php如何调用windows自带的计算器calc.exe, 并弹出界面来。 新手,大家帮我看看这段代码. ...这个问题,还真不知道怎么问~~关于apache php php+sqlserver,如何读取sqlserver2000中的image类型的图片到网页中 请问那里有人才(求职、招聘)的程序? PHP和HTML的版本有没有关系? RSS 采集的问题 求助,一个关于正则表达式截取字符串的问题
<label>
<input type="checkbox" name="checkbox" value="game" />
游戏
<input name="checkbox" type="checkbox" id="checkbox" value="movie" />
电影 <input name="checkbox" type="checkbox" id="checkbox" value="music" />
音乐</label>
<input type="submit" name="Submit" value="提交" />
</form>
<?php
if ($_POST['checkbox']!=""){
$box=$_POST['checkbox'];
echo $box;
}
?>
<input type="checkbox" name="Name[]" value="Value_1" />
...
<input type="checkbox" name="Name[]" value="Value_n" />$chk = $_POST["Name"]; //$chk是一个数组
if ($_POST['checkbox']!=""){
$box=$_POST['checkbox'];
foreach ($box as $value){
echo $value;
}
}
?>
是这样吗 出错了啊
<label>
<input type="checkbox" name="checkbox[]" value="game" />
游戏
<input name="checkbox[]" type="checkbox" id="checkbox" value="movie" />
电影 <input name="checkbox[]" type="checkbox" id="checkbox" value="music" />
音乐 </label>
<input type="submit" name="Submit" value="提交" />
</form>
<label>
<input type= "checkbox " name= "checkbox[] " value= "game " />
游戏
<input name= "checkbox[] " type= "checkbox " id= "checkbox " value= "movie " />
电影 <input name= "checkbox[] " type= "checkbox " id= "checkbox " value= "music " />
音乐 </label>
<input type= "submit " name= "Submit " value= "提交 " />
</form>
<label>
<input type="checkbox" name="checkbox[0]" value="game" />
游戏
<input name="checkbox[1]" type="checkbox" id="checkbox" value="movie" />
电影 <input name="checkbox[2]" type="checkbox" id="checkbox" value="music" />
音乐</label>
<input type="submit" name="Submit" value="提交" />
</form>
<?php //获取复选框多个值
if ($_POST['checkbox']!=""){
$box=$_POST['checkbox'];
foreach ($box as $key=>$value){
echo $key,$value;
}
}
?>谢谢 搞定了!!!