Welcome to WebmasterWorld Guest from 54.147.44.93

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Change settins in .ini file

register_globals valus is not changing

     

compose

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

5+ Year Member



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

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

WebmasterWorld Senior Member 5+ Year Member



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

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

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 5+ Year Member




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

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

5+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



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

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

5+ Year Member



Hello,

Thanks a lot bridman, now it's working.

Thanks all for your time, and input.

Warm Regards,

Vineet

 

Featured Threads

Hot Threads This Week

Hot Threads This Month