<?php
if($submit) {
print_r($test);
}
?>
<form action="<?php echo $PHP_SELF;?>" method="post">
<input type="checkbox" name="test[]" value="1">
<input type="checkbox" name="test[]" value="2">
<input type="checkbox" name="test[]" value="3">
<input type="checkbox" name="test[]" value="4">
<input type="checkbox" name="test[]" value="5">
</form>
if($submit) {
print_r($test);
}
?>
<form action="<?php echo $PHP_SELF;?>" method="post">
<input type="checkbox" name="test[]" value="1">
<input type="checkbox" name="test[]" value="2">
<input type="checkbox" name="test[]" value="3">
<input type="checkbox" name="test[]" value="4">
<input type="checkbox" name="test[]" value="5">
</form>
phpteam 这段代码我也看过哦,不过不知道为何还是不行哦
<?php
if($submit) {
for($i=0;$i<count($test);$i++){
echo $test[$i];
}
}
?>
<form action="<?php echo $PHP_SELF;?>" method="post">
<input type="checkbox" name="test[]" value="1">
<input type="checkbox" name="test[]" value="2">
<input type="checkbox" name="test[]" value="3">
<input type="checkbox" name="test[]" value="4">
<input type="checkbox" name="test[]" value="5">
<input type="submit" name="submit" value="OK">
</form>
也还是接收不到test数组,经常报一些错误.
PHP4环境有很多种,4.1.0之前和之后变量接收就不一样,在这解答的朋友都是提供解决方法而不是代码,具体需求是需要你自己修改的,并不是说我给你的代码就完全正确。
另外应该是<?不要了,而不是<?php,这是为了跟其他语言的区别。
在下急于使用,而且您贴出的方案我很早已经试过了,但是在我这里没有调试成功
应该是我这里的问题。感谢你提供的方案,不到之处请见凉。
呵呵,千万不要怒哦!
2、贴出你不成功的代码
3、php要求同名表单变量用数组形式设置