[PHP-DOC] Bug #12557 Updated: register_globals can not be set using ini_set. From: andy <email protected>
Date: 08/03/01

ID: 12557
Updated by: andy
Reported By: boyzone_2001 <email protected>
Old Status: Bogus
Status: Feedback
Bug Type: Documentation problem
Operating System: win/linux both
PHP Version: 4.0.4pl1
New Comment:

ok, didn't read the whole thing. Which documentation page
did you see this on?

Previous Comments:
------------------------------------------------------------------------

[2001-08-03 14:28:37] andy <email protected>

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 <email protected>

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