Re: Weird bug with HTML_QuickForm
| From: | Justin Patrin | Date: | Mon, 14 Mar 2005 23:33:36 +0000 |
| Subject: | Re: Weird bug with HTML_QuickForm | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-18042@lists.php.net to get a copy of this message | ||
On Mon, 14 Mar 2005 18:13:46 -0600, daneel <daneel@epseelon.org> wrote:
> OK I finally found the bug, and not a small one ! THE bug :)
> The problem was that "something" was added to a group and it was not an
> array of elements. I would like to thank the FAQ guys because it gave me
> the hint to start with. But the thing was that the bug only occurred on
> my remote server and not on localhost. So there couldn't be a mistake in
> my form. And it took me another 2 hours to realize that... on my remote
> server... register_globals was On !!! Bouuuuuuh ! Too bad ! Amateurs !!!
> Everybody knows that it's one of the first thing to do when you setup
> PHP : turn register_globals OFF lol
> I know it's a matter of choice and I'm a bit excessive... but there I
> would have appreciated them to CHOOSE THE SAME OPTION AS ME !!!
> Nevermind, as register_globals was on, some of the variable names
> refering to the arrays of elements added to some groups were...
> overriden by POST variables...
> I should have checked the difference between PHP configurations.
> Anyway. Thank you for your help and remember :
>
> TURN REGISTER_GLOBALS OFF !!! (or at least check the configurations... :o)
>
An even better answer is to put the meat of your code in classes and
just instantiate one or 2 in the normal global script. This way you
know what your namespace is. ;-)
--
Justin Patrin