Forum Moderators: coopster
It is going to take me some time to get it sorted but what I wish to know is is using the $_GET['var'] and the like backward compatible?
phphmyadmin seems to work in both situations so I am a little confused.
As it stands I have to do the old:
$var = $_POST['var']
but if I ever have to adapt to a host that has register on I dont want ohave to spend a week sorting it out.
Cheers
Essentially all register_globals does is extract [ca.php.net] or import_request_variables [ca.php.net]. The original vars are there in both cases but you can't access them by $var (without intervention) with register_globals off.
The only time $_POST, or the like, will cause an issue is if your version is less than 4.1.0 and then you would need to use $HTTP_POST_VARS, $HTTP_GET_VARS etc.
but if I ever have to adapt to a host that has register on I dont want ohave to spend a week sorting it out.
A tip for you:
You can toggle whatever your host has for this directive by simply adding an .htaccess file to your php code directories with a single line to turn the register_globals on/off:
php_flag register_globals off
Then you won't have to modify your code ;)
This thread [webmasterworld.com...] has a good discussion about register_globals.
Coopster
I found this on my travels wrt your method of turning register globals on and off on your host. If you are on a vhost you need to have a line or two in your httpd.conf file.
<Directory /whatever/>
AllowOverride Options
</Directory>
(AllowOverride All will also work.)
Cheers