Bug #12557 Updated: register_globals can not be set using ini_set.

From: Date: Fri, 03 Aug 2001 18:48:49 +0000
Subject: Bug #12557 Updated: register_globals can not be set using ini_set.
References: 1  Groups: php.dev php.doc 
Request: Send a blank email to php-dev+get-62003@lists.php.net to get a copy of this message
ID: 12557 Updated by: andy Reported By: boyzone_2001@yahoo.com Old Status: Bogus Status: Analyzed Bug Type: Documentation problem Operating System: win/linux both PHP Version: 4.0.4pl1 New Comment: i think that the documentation should say that register globals can be set with .htaccess, php.ini, or httpd.conf. Previous Comments: ------------------------------------------------------------------------ [2001-08-03 14:34:49] boyzone_2001@yahoo.com i found it here. http://www.php.net/manual/en/function.ini-set.php jd ------------------------------------------------------------------------ [2001-08-03 14:32:50] boyzone_2001@yahoo.com yeah i know that. but atleast in documentation u can chanage it so that other user wont try the same thing. thats y i am posting this !! jd ------------------------------------------------------------------------ [2001-08-03 14:32:34] andy@php.net ok, didn't read the whole thing. Which documentation page did you see this on? ------------------------------------------------------------------------ [2001-08-03 14:28:37] andy@php.net this is supposed to happen, think about it. By the time you get to the ini_set statement, PHP has already "registered the globals" :) Use either php.ini, .htaccess, or httpd.conf ------------------------------------------------------------------------ [2001-08-03 13:34:23] boyzone_2001@yahoo.com ok here is my probelm. generally in php.ini settings register_globals are ON. now anyway i want to have them OFF. a quick search through manual found me a function which can change it that is ini_set. it requires the directive and the value for it to be passed and it would be changed. but even though i change the register_globals it doesnt have any effect. below is my code. PHP:-------------------------------------------------------------------------------- <?php $setting = ini_get('register_globals'); print "Current setting of register_globals is $setting<br>"; $check = ini_set('register_globals','0'); // i have tried putting 0,'0', off,'off' but all to no avail. if(! $check) { print "Can not change setting.<br>"; exit; } $new_setting = ini_get('register_globals'); print "New setting of register_globals is $new_setting<br>"; print "Now let us check if it worked. Make sure u have called script with fundoo parameter.<br>e.g. :: script.php?fundoo=something, <br>it would be printed again.<br>"; print "Fundoo is $fundoo"; ?> -------------------------------------------------------------------------------- i have tried to put up every possible value that i can assume but still it doesnt work. i have tested this on my win machine it doesnt work. and on linux machine too, on which it doesnt work either. u can check script here. http://www.jdk.f2s.com/drms/admin.php?fundoo=something so the point is that its not possible to change register_globals using ini_set. its not working. though it works with .htaccess so i would like u to change wat i mentioned in documentation. u can change the description in manual regarding ini_set function which says that register_globals can be changed everywhere by specifying PHP_INI_ALL . it should be PHP_INI_PERDIR|PHP_INI_SYSTEM thats it, jd ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=12557&edit=1

« previous php.dev (#62003) next »