Forum Moderators: coopster

Message Too Old, No Replies

php.ini and register globals = Off

any way to bypass it?

         

omoutop

1:21 pm on Feb 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi all!

Quick question:

My hosting service just turned the registered globals to Off, some of my sites are not working properly...
Is there any way to turn them on somehow or do I need to go and change my code!? .htaccess maybe?

Thanks in advance!

Scally_Ally

3:18 pm on Feb 16, 2006 (gmt 0)

10+ Year Member



read this somewhere..

Create .htaccess, and put

php_flag register_globals on (or off)

Put .htaccess file in the root directory

dont know if it will work.. never tried, although having the register globals turned on is meant to be a high security risk.

coopster

5:40 pm on Feb 16, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



True on both accounts, Scally_Ally. If your host allows it you can override this directive in a per-directory override file (.htaccess). However, there are security issues involved here. If you haven't read up on Using Register Globals [php.net] yet, you really need to.

omoutop

5:33 am on Feb 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thank you for your answers, I ussually employ htaccess for redirections and creating htm pages from php pages and I have also seen the line:

php_flag register_globals on (or off)

but never really rknew if this would override for sure the server configurations. So, as long as my hosting service is providing me mod rewrite and ht access I can turn registered globals on and off (per directory always) anytime I want. That is good news :) However I will take a look again on the security measures and I do believe that there are ways of securing code even if globals are on.

Thank you again both

coopster

2:25 pm on Feb 17, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



omoutop, for future reference you may want to keep in mind that there is appendix [php.net] in the PHP manual that has a listing of the PHP directives and where/when they can be overridden. This page is invaluable ;)