OK, I'm having a very bizarre problem with an array of checkboxes.
<input type="checkbox" id="del[]" name="del[]" value="1" />
<input type="checkbox" id="del[]" name="del[]" value="2" />
<input type="checkbox" id="del[]" name="del[]" value="3" />
Now, in theory, I should be able to get an array of values by referencing $POST['del'] or $REQUEST['del']. In fact, I've done this hundreds of times. Should be easy.
Well, here's my problem. Say we post the form above to my PHP script. Script contains the following code:
header('content-type: text/plain');
print_r($_REQUEST);
print "Type: ".gettype($_REQUEST['del'])."\n";
This is the output I get:
Array
(
[del] => Array
[PHPSESSID] => blahblahblahblah
)
Type: string
So, what's up with that? You would think from the output of print_r that $_REQUEST['del'] is an array ... except that it doesn't print the contents of the array like you would expect print_r to do. Even if it was empty, I would expect to get:
Array
(
)
Furthermore, gettype indicates that $_REQUEST['del'] is a string.
I'm stumped here.
I'm running PHP 4.3.9 on Mac OS X 10.3.9, with Apache 2.0.52.
(Yeah, I know I'm behind two version on PHP, I haven't updated because it's only my laptop)