3. The Quick and Dirty way to keep using register global variables
If your Web site isn't going to exist much longer, or is due for a major rewrite soon anyway, or uses scripts that you don't feel like patching (e.g., osCommerce 2.2 MS2), you can still turn on register global variables (for the time being).
Note: this discussion assumes that you are on a shared server running Linux and Apache server (Basic and Business plans). If you are on a Virtual Private Server (VPS), dedicated server, or Windows-based server, these instructions may not apply, and you'll need to find out how to do it on your server. For example, on a Linux/Apache VPS or dedicated server, you may have your PHP settings in a file named httpd.conf instead. Maybe.
First, you need a file called php.ini that contains various settings for the use of PHP. You may already have one if you needed to, say, set larger limits for uploaded files. If not, you will have to create a new file named php.ini somewhere. It is simplest to put it in /home/YOUR_ACCOUNT_NAME/public_html/, but you should take measures to keep others from peeking into this file. Some people like to put it in /home/YOUR_ACCOUNT_NAME/ instead -- that's secure against prying eyes. It is possible to have just one php.ini that applies to your entire site, or you can have different php.ini files for the use of different subsystems. Of course, different php.ini files need to be placed in different directories, usually the "root" directory of the system that needs its particular settings.
The php.ini file, whether new or existing, and wherever it is, needs to contain the line:
register_globals = on
(Capitalization doesn't really matter.) The permissions are usually "644".
Second, you need to add lines to your .htaccess file to tell PHP where to find your applicable php.ini file. Let's say you put it in /home/YOUR_ACCOUNT_NAME/public_html/. The entry in .htaccess would be:
Obviously, YOUR_ACCOUNT_NAME in these instructions is replaced by your account name (the one you sign onto cPanel with). It's not the server name. You can have multiple .htaccess files in different directories to control your site, so make sure each one points to the appropriate php.ini file (a simple matter if you have only one). If you put your php.ini file in /home/YOUR_ACCOUNT_NAME/, that's all you need to do. However, if it was placed in any directory in or below /home/YOUR_ACCOUNT_NAME/public_html/, any browser will be able to look at it unless you add the following lines to the .htaccess file:
deny from all
That should keep out snoopers.
So, now you have a php.ini file controlling your PHP usage, with settings that include a request to turn register global variables back on so you can use them. Please note that in doing this, you are making your PHP code somewhat less secure than it would otherwise be. You also have an entry in the .htaccess file telling PHP where to find its php.ini file with the settings to use.
A final note: some old PHP books and instructions will tell you to put a line in .htaccess similar to:
php_value register_globals on
Don't do this. "php_value" doesn't work anymore on Lunarpages servers. Put PHP settings into your php.ini file.