How to turn on Register Globals



I am an absolute new to programming.

Can anyone tell in details how to “Turn on Register Globals”.

Once, I called up a file in a text editor - the file is “php.ini recommended” something like that under c:php.

Although I made change in the text editor, the register globals still appears as “OFF”.

Please highlight me step by step what’s the proper procedure.

Many thanks. :oops:


I’d like to strongly recommend to leave register_globals OFF and program your scripts using the $_GET, $_POST and $_COOKIE superglobals. If you click the link in my signature (the one about Register Globals) you can read an article on why it was turned off in PHP 4.2.0 (or near that, not sure). Please use the superglobals with register_globals set to OFF to greatly improve the security of your scripts and host machine.

Conclusion: I’d gladly offer help turning on register_globals to anyone who knows what they’re doing, but since you mentioned that you’re ‘absolute new to programming’, it’d be like giving a 6-year-old a gun to play with, so to speak :wink:



Many thanks for your swift reply and explanation.

Now I understand the “drawbacks” of turning on register_global.

However, to give it a try and know more about the functions, I would like to know the “METHODS” to gain control of the facilities.

Secondly, many books need this register_global function for demonstration at the beginning chapters, which I want to give it a try.

On the other, if a kid knows more about the downsides and upsides of a things, and he is well equipped when doing the test, then I think the try will be more meaningful to him, instead just leave out the “awful things”.

Therefore, I would like you to tell/demonstrate me the steps for “turning on”, while afterwards and in real live application, I can “shut it down” according.

At last, can you name me a decent “file comparison” freeware, that I can make comparison with download files.

Many thanks!!!


Well, I’m not going to give you links to software, as that’s what google is for. I guess the next safest solution (but still dangerous) is to use ini_set() to turn on register_globals. Again I’d seriously advise against turning it on the php.ini files.



Excellent!!! Thanks for reply!!!

I see what you mean and I think I can handle it with your given FUNCTION.

Thanks and have a nice holiday!!! :lol: