I'm trying to use checkboxes as you would normally expect (at least how I remember), but for some reason when I use the POST method it screws things up. If I use the GET method it works okay. Here's my test code (using POST):
<html>
<body>
<pre>
<?php if (isset($_POST)) { var_dump ($_POST); } ?>
</pre>
<form method="post" action="checkboxtest.php">
<input name="cb[]" type="checkbox" value="1">1<br />
<input name="cb[]" type="checkbox" value="2">2<br />
<input name="cb[]" type="checkbox" value="3">3<br />
<input name="cb[]" type="checkbox" value="4">4<br />
<br />
<input type="submit" value="submit">
</form>
</body>
</html>
And here's the output I get from the var_dump():
array(1) {
["cb"]=>
array(3) {
[0]=>
string(1) "1"
[1]=>
string(7) "3cb[]=1"
[2]=>
string(1) "3"
}
}
Something's not happening right. Any ideas of what's wrong?
Nolan