I'm having a problem with an array of checkboxen in a form that isn't
passing on its values when the form is submitted.

At first I thought this was related to the register_globals since I just
updated to php 4.2.1 a week or so ago..  I've read the information that says
it's turned off by default now, but when I checked on my php.ini file, my
register_globals was already set to On.  (I had updated from an earlier
version of php, so I assume it left my .ini file)

Here's the problem I'm having.   I have a form that looks something like
this (except it's pulled from a db... I'm stripping it down to have the
essentials here :) :

<form action="submit.php" method="post">
<input type="checkbox" name="Checkbox_List[]" value="option1">Option 1<br>
<input type="checkbox" name="Checkbox_List[]" value="option2">Option 2<br>
<input type="submit" name="Submit" value="Submit List">
</form>

and the submit processing of the submit.php page is:

if ($Submit == "Submit List) {
        echo "checkbox list:<br>\n";
        foreach ($Checkbox_List as $A_Checkbox_Item) {
                echo "checkbox item: $A_Checkbox_Item<br>\n";
        }
        Submit_List($Checkbox_List);
}


Here's the problem:  if I check some checkboxen on the page, and then
submit, the output is:

checkbox list:

Nothing seems to be getting passed with the chechbox array...  If I use the
$_POST["Checkbox_List"] variable instead, the data is there...  I'm just
confused as to why register_globals doesn't fix the problem w/out me having
to use the _POST array?  (we have numerous pages that use the old method,
and it'll take some time to convert them all, so register_globals is needed
for now)

The thing that seems _reall_ strange to me, is that it looks like _some_ are
being registered, and others are not...  Like the $Submit variable (from the
input button), that is obviously being passed, otherwise I wouldn't see any
output (first echo inside the if) when it's submitted.

Any ideas on why some data is being passed but not all of it?  This page was
working ok on a pre-4.2 system.
My current config on this server is:

RedHat 6.1 (kernel 2.4.17)
Apache 1.3.26
PHP 4.2.1

thx

Kevin Hanser
System Administrator
Merchant Internet Group, Inc.
ShopsForMe.com
[EMAIL PROTECTED]
[EMAIL PROTECTED]


-- 
PHP Install Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to