We've got a client application that relies on register_globals turned on to work, but we're hosting it on a our shared server, and don't want to turn register_globals on in our main php.ini file.
I tried inserting ini_set ( 'register_globals' , 'On' );
but it didn't work. Why didn't it? And is there a better way?
You could always try to put:
extract($_REQUEST,EXTR_SKIP); //thanks @Wayne Whitty
on top of every files. It would yeld the same results as far as I know. But really, REALLY, its bad bad bad to use these. I'd look for a way to change the code. But sometimes you have no choice.
From the php documentation:
Please note that register_globals cannot be set at runtime (ini_set()). Although, you can use .htaccess if your host allows it as described above. An example .htaccess entry: php_flag register_globals off.
link to php documentation on register_globals
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With