Re: [PHP] PHP 4.10: any way to override register_globals = OFF
Just FYI - if you use extract($_REQUEST), you're exposed to the very same danger that exists in register_globals. You're much better off using import_request_variables(), which allows you some control over what you put in the global scope. Zeev At 01:14 18/12/2001, Michael Jurgens wrote: Hey Guys, Thanks a lot, I allways use some config files that I include in every page, and with extract ($_REQUEST); added to one of those files, almost all of my problems are history. I'm now working on getting $PHP_SELF etc back working, but that should work out. Amazing this newsgroup, thank you all, Greetz, Michael Richard Heyes [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... for all in $_GET { $[varname] = $_GET[varname] } Could anyone give me some pointers in actually programming this? extract($_GET); -- Richard Heyes If you have any trouble sounding condescending, find a Unix user to show you how it's done. - Scott Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP 4.10: any way to override register_globals = OFF
Hi, Now that register_globals is (or will be) OFF by default (just like error_reporting) I'm facing a huge rewrite of existing code if my hosting provider decides that he wants to upgrade his php (and believe me, he will use default settings) Is there any way to override register_globals and error_reporing runtime in your PHP script? (there is no way that I can use .htaccess to override :-(( Any help would be much appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP 4.10: any way to override register_globals = OFF
a quick and inelegant hack 4.1 includes an array that has all of the data sent to the script...(or use the different ones like $_GET etc if need be) then write a globalize function that extracts the vars and declares them global...then use this snippet in an auto_prepend file to magically register the vars there's probably a much easier way, including asking your hosting provider to change one little config var... jack Michael Jurgens wrote: Hi, Now that register_globals is (or will be) OFF by default (just like error_reporting) I'm facing a huge rewrite of existing code if my hosting provider decides that he wants to upgrade his php (and believe me, he will use default settings) Is there any way to override register_globals and error_reporing runtime in your PHP script? (there is no way that I can use .htaccess to override :-(( Any help would be much appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP 4.10: any way to override register_globals = OFF
a quick and inelegant hack 4.1 includes an array that has all of the data sent to the script...(or use the different ones like $_GET etc if need be) then write a globalize function that extracts the vars and declares them global...then use this Or use extract(). -- Richard Heyes If you have any trouble sounding condescending, find a Unix user to show you how it's done. - Scott Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP 4.10: any way to override register_globals = OFF
Thank you for your answers. The hack seems the way to go, but I haven't found anything like this on the net. Presumably because the 'problem' is so new... I have absolutely no control over my hosting providers settings, and I wish PHP 4.10 would just understand something like set_register_globals I haven't got that much experience with playing with variables at this level. What would do the trick is something like this: for all in $_GET { $[varname] = $_GET[varname] } Could anyone give me some pointers in actually programming this? Many thanks, Michael Richard Heyes [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... a quick and inelegant hack 4.1 includes an array that has all of the data sent to the script...(or use the different ones like $_GET etc if need be) then write a globalize function that extracts the vars and declares them global...then use this Or use extract(). -- Richard Heyes If you have any trouble sounding condescending, find a Unix user to show you how it's done. - Scott Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP 4.10: any way to override register_globals = OFF
exactly...in the function you'd have to extract the variables then globalize them... or you could loop through the arrays and store the keys and values in the globals array...that loop should be simple... jack -Original Message- From: Richard Heyes [mailto:[EMAIL PROTECTED]] Sent: Monday, December 17, 2001 4:54 PM To: Jack Dempsey; Michael Jurgens Cc: [EMAIL PROTECTED] Subject: RE: [PHP] PHP 4.10: any way to override register_globals = OFF a quick and inelegant hack 4.1 includes an array that has all of the data sent to the script...(or use the different ones like $_GET etc if need be) then write a globalize function that extracts the vars and declares them global...then use this Or use extract(). -- Richard Heyes If you have any trouble sounding condescending, find a Unix user to show you how it's done. - Scott Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP 4.10: any way to override register_globals = OFF
for all in $_GET { $[varname] = $_GET[varname] } Could anyone give me some pointers in actually programming this? extract($_GET); -- Richard Heyes If you have any trouble sounding condescending, find a Unix user to show you how it's done. - Scott Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP 4.10: any way to override register_globals = OFF
Jack $_GET is automatically global to all scopes. No need to globalize. chuck - Original Message - From: Jack Dempsey [EMAIL PROTECTED] To: Michael Jurgens [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, December 17, 2001 10:49 PM Subject: Re: [PHP] PHP 4.10: any way to override register_globals = OFF a quick and inelegant hack 4.1 includes an array that has all of the data sent to the script...(or use the different ones like $_GET etc if need be) then write a globalize function that extracts the vars and declares them global...then use this snippet in an auto_prepend file to magically register the vars there's probably a much easier way, including asking your hosting provider to change one little config var... jack Michael Jurgens wrote: Hi, Now that register_globals is (or will be) OFF by default (just like error_reporting) I'm facing a huge rewrite of existing code if my hosting provider decides that he wants to upgrade his php (and believe me, he will use default settings) Is there any way to override register_globals and error_reporing runtime in your PHP script? (there is no way that I can use .htaccess to override :-(( Any help would be much appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP 4.10: any way to override register_globals = OFF
i understand that, but if he extracts inside a function, those variables will be in that scope. if his auto_prepend file is simply 'extract($_GET)' then that'd be fine as well jack -Original Message- From: Charles Williams [mailto:[EMAIL PROTECTED]] Sent: Monday, December 17, 2001 5:59 PM To: Jack Dempsey; Michael Jurgens Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PHP 4.10: any way to override register_globals = OFF Jack $_GET is automatically global to all scopes. No need to globalize. chuck - Original Message - From: Jack Dempsey [EMAIL PROTECTED] To: Michael Jurgens [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, December 17, 2001 10:49 PM Subject: Re: [PHP] PHP 4.10: any way to override register_globals = OFF a quick and inelegant hack 4.1 includes an array that has all of the data sent to the script...(or use the different ones like $_GET etc if need be) then write a globalize function that extracts the vars and declares them global...then use this snippet in an auto_prepend file to magically register the vars there's probably a much easier way, including asking your hosting provider to change one little config var... jack Michael Jurgens wrote: Hi, Now that register_globals is (or will be) OFF by default (just like error_reporting) I'm facing a huge rewrite of existing code if my hosting provider decides that he wants to upgrade his php (and believe me, he will use default settings) Is there any way to override register_globals and error_reporing runtime in your PHP script? (there is no way that I can use .htaccess to override :-(( Any help would be much appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP 4.10: any way to override register_globals = OFF
Hey Guys, Thanks a lot, I allways use some config files that I include in every page, and with extract ($_REQUEST); added to one of those files, almost all of my problems are history. I'm now working on getting $PHP_SELF etc back working, but that should work out. Amazing this newsgroup, thank you all, Greetz, Michael Richard Heyes [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... for all in $_GET { $[varname] = $_GET[varname] } Could anyone give me some pointers in actually programming this? extract($_GET); -- Richard Heyes If you have any trouble sounding condescending, find a Unix user to show you how it's done. - Scott Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: Re: [PHP] PHP 4.10: any way to override register_globals = OFF
you can do this to get what u want: foreach($_GET as $key = $val){ $$key = $val; } this is what u want to do, right? :) for all in $_GET { $[varname] = $_GET[varname] } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]