[how to on or off register_global]

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
cloud_0085
Forum Newbie
Posts: 4
Joined: Sun Apr 16, 2006 8:48 pm

[how to on or off register_global]

Post by cloud_0085 »

hello, can someone tell me how to on or off the register_global??
thanks. :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

.htaccess, web server configuration file (depending on server) and in php.ini
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Although anything from inside the PHP script won't do much since the globals have already been registered... ;-)
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

.htaccess file containing the line "php_flag register_globals off"...

That assumes you are using Apache.
cloud_0085
Forum Newbie
Posts: 4
Joined: Sun Apr 16, 2006 8:48 pm

Post by cloud_0085 »

thanks a alot.. :lol:
phpwalker
Forum Commoner
Posts: 81
Joined: Sun Apr 23, 2006 12:18 pm

Post by phpwalker »

I used ini_set(), however, it doesn't work. It doesn't show any error as well, I assumed that it has already taken effect. When I check on phpinfo(), it was still the same setting. Such as I turn on the error_log, but still remained off.
What is the problem? Priviledge problems?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

http://php.net/manual/en/ini.php lists when and where you can set directives.
Post Reply