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

From: boyzone_2001 <email protected>
Operating system: win/linux both
PHP version: 4.0.4pl1
PHP Bug Type: Documentation problem
Bug description: register_globals can not be set using ini_set.

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 bug report at: http://bugs.php.net/?id=12557&edit=1