For some reason my checkbox array values don't show up in $_POST.
For example:
<form method="post" action="">
<input type="checkbox" name="cb[]" value="1">
<input type="checkbox" name="cb[]" checked="checked" value="2">
<input type="checkbox" name="cb[]" value="3">
<input type="checkbox" name="cb[]" checked="checked" value="4">
<input type="checkbox" name="cb[]" checked="checked" value="5">
<input type="checkbox" name="cb[]" value="6">
...
<input type="checkbox" name="cb[]" checked="checked" value="26">
<input type="checkbox" name="cb[]" value="27">
<input type="submit" value="insanitizer"/>
</form>
When submit:
<?php
print_r($_POST); //Because print_r($_POST['cb']); gives ''
Array (
[category] =>
)
print_r($_REQUEST['cb']); //Showing the correct array name was used
Array
(
[0] => 2
[1] => 4
[2] => 5
[3] => 26
)
?>
I'm happy that I can at least get the checkbox data here, but I'm left with one question:
Wtf?