Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'It broke my web apps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
It broke my web apps
Authored by: deleted_user2 on Apr 30, '02 11:34:35PM
In PHP 4.2.0 global variables are accessed very differently. In previous versions, if you passed in a GET variable to a script it was automatically available everywhere in your script, most old PHP is written based on this assumption. This is no longer the default behavior. One way to fix most of the problems with the new variable structure is to just turn the old way back on. Although you won't have the new added security from PHP 4.2.0, it can offer you a transitional phase while you update your code. To make the old global variable structure work again you just edit your php.ini file in /usr/local/lib (create it if it doesn't exist) and change or add the line: register_globals=on This gives you a chance to change all your $random_get_var to $_GET["random_get_var"] (or just pop something this at the beginning of your code: $random_get_var = $_GET["random_get_var"];). Hope that helps Jeremy Gustie http://www.gustie.com:1313/

[ Reply to This | # ]
It broke my web apps
Authored by: carter on May 01, '02 08:49:58AM

Thank you for this information. I had suspected that my problem was centered around this change (globals) but with my limited knowledge, I was not sure. I also appreciate your help with the temporary fix as well as the recoding help.
Many, many thanks!



[ Reply to This | # ]
It broke my web apps
Authored by: wnixon on Jun 07, '02 05:34:34PM

Regarding, creating the php.ini file. Is there anything else that would need to go into this file other than the one line regarding globals? Will it affect the configuration of php other than the globals?

Thanks, Walt



[ Reply to This | # ]
It broke my web apps
Authored by: wnixon on Jun 20, '02 11:20:12PM

Regarding, creating the php.ini file (which I don't have now). Is there anything else that would need to go into this file other than the one line regarding globals? Will it affect the configuration of php other than the globals?

Thanks, Walt



[ Reply to This | # ]