Home  >  Article  >  Backend Development  >  初学者,关于post传值的有关问题,

初学者,关于post传值的有关问题,

WBOY
WBOYOriginal
2016-06-13 12:48:02890browse

菜鸟求助,关于post传值的问题,在线等啊在线等
我写了个简单的程序,但运行不出想要的结果,请大家看看
form.php








添加投票选项:





注意:每个选项之间用*分隔



form1.php







if($_POST[Submit]!=""){
$content=$_POST[content];
$data=explode("*",$content);
while(list($name,$value)=each($data)){
echo '';
echo $value."\n";
}
}
?>


form3.php
if($_POST["Submit"]!=""){
echo "您的选择是:".$_POST[checkbox];
}
?>
运行结果:在from.php中输入java*php*.net
请问为什么在form3.php中输出不了在form2.php里选的选框中的内容,只会输出checkbod呢

------解决方案--------------------
只有value属性的值才会被提交过去,因此应该改为:
while(list($name,$value)=each($data)){
echo 'checkbox[]" value="'.$value.'">';
echo $value."\n";
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn