homepage Welcome to WebmasterWorld Guest from 54.197.111.87
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Change settins in .ini file
register_globals valus is not changing
compose




msg:3097334
 11:53 am on Sep 26, 2006 (gmt 0)

Hello,

I am facing a little problem, on my server php is configured with register_globlas off setting, but now i want to on this setting, i used ini_set("register_globals","On"); command to on this setting but stillit is off. Can any body guide me how i can make this settingon.

I also used .htaccess file to on this -

php_flag register_globals on
php_value register_globals 1

but both are not working.

Please help me to short out this problem.

Warm Regards,

Vineet

 

phparion




msg:3097344
 12:01 pm on Sep 26, 2006 (gmt 0)

ini_set() function changes the .ini values only for your script's life time i.e as soon as your script dies the changes implemented using ini_set are removed and they dont affect .ini settings permanently..

also if you are writing a general use application then it is always a better practice to use Globar Arrays to get variables i.e $_GET, $_POST etc etc. ..

eelixduppy




msg:3097829
 4:50 pm on Sep 26, 2006 (gmt 0)


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 off.

[us3.php.net...]

If you can, set it in your php.ini.

Also note that you should be careful when turing register_globals on. Read this [us2.php.net] for more information on what to look out for!

Good luck!

compose




msg:3098539
 3:54 am on Sep 27, 2006 (gmt 0)

Hello ,

Thanks for your information. Means my .htaccess code is fine but as per you my host is not supporting this so i will not be able to change this setting? right? so in this case what i can do to turn it on.

One more question, it means we can't update ini settings in run time?

I also don't like to work with register_globals on setting, but due to some reason i have to use this.

Regards & thanks,

Vineet

Birdman




msg:3098546
 4:11 am on Sep 27, 2006 (gmt 0)

I also don't like to work with register_globals on setting, but due to some reason i have to use this.

You don't have to do anything you don't want to do.

If you want to call globals easily, you could always extract() them.

extract($_GET);
extract($_POST);

Then, they can be used in the same manner as with register globals on.

compose




msg:3100034
 4:53 am on Sep 28, 2006 (gmt 0)

Hello,

Thanks a lot bridman, now it's working.

Thanks all for your time, and input.

Warm Regards,

Vineet

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved