Page 1 of 1

Can I turn off register_globals for only my domain?

Posted: Mon Oct 14, 2002 12:01 pm
by drock
My ISP has register_globals turned on by default, I imagine this is set in their server's php.ini file and I would like to turn it off. Is there a file equivelant to php.ini that I can use to set PHP params like register_globals for only my domain?

Thanks,
David Rock

Posted: Mon Oct 14, 2002 1:15 pm
by rev
Pulling from php.net...

"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 on."

http://www.php.net/manual/en/configurat ... ctives.php

Posted: Tue Oct 15, 2002 2:05 am
by twigletmac
It shouldn't matter whether reg_globals is on or off if you write your code to be specific about where it gets its variables (using $_POST, $_GET etc) and are careful about variable naming and initialising within your script then you should be fine.

Mac

Posted: Tue Oct 15, 2002 2:16 am
by volka
not everyone is pleased to rewrite all scripts ;)
Imagine phpBB couldn't handle register_globals=off (ok, you would use another board; but if there were no others....)