Page 2 of 2

Posted: Fri Sep 20, 2002 10:21 am
by nielsene
Aha!

You have register_globals on so when your processing script starts
preselectvar has already had its values assigned. Then you assign the
form values to an element of preselectvar.

What you want to do is

Code: Select all

$preselectvar = $HTTP_POST_VARSї"preselectvar"];
don't include the []'s when you want to assign the whole array. In PHP the empty []s tell it to assign whatever come next to the first empty spot of the array, not to overwrite the whole array.

Posted: Fri Sep 20, 2002 10:37 am
by coolen
ok, thanks for all your help.

I do hope that the used construction is working for both setting from register_globals though :O(

Posted: Fri Sep 20, 2002 10:40 am
by nielsene
Yes the corrected version will work under either setting of register_globals. The incorrect version would have failed under either, but the array would have looked different.