Can I turn off register_globals for only my domain?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
drock
Forum Newbie
Posts: 7
Joined: Fri Jun 14, 2002 12:49 pm
Location: Boulder, CO

Can I turn off register_globals for only my domain?

Post 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
rev
Forum Commoner
Posts: 52
Joined: Wed Oct 02, 2002 3:58 pm
Location: Atlanta, GA

Post 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
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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....)
Post Reply