THINGS TO WATCH OUT FOR :: Since PHP 4.2 was released, 'Register Globals' have been switched off by default for security reasons. If you are aware of the risks involved and you have access to the php.ini file, you can turn them back on (although this is NOT recommended). What's the impact of this ? With REGISTER_GLOBALS turned ON, you may unknowingly introduce a security risk in your script which allows a user to change a value. In contrast, turning them OFF does not automatically make scripts secure. But it does mean, for instance, that posted form values have to be assigned on the receiving page. The 7 new superglobals were introduced in PHP 4.1 $_POST If your version of PHP is pre 4.1 then use the following in place of the superglobals (but be aware they are deprecated and may therefore be phased out in later versions): $HTTP_POST_VARS a) $HTTP_SERVER_VARS and $_SERVER are not exactly equivalent. b) There is no equivalent for $_REQUEST prior to PHP 4.1 With Register Globals OFF, the following will not work:
| |||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
Although the new method will work OK: | |||||||||||||||||
| |||||||||||||||||
TIP - do *everything* assuming Register Globals are OFF. Next: Magic Quotes | |||||||||||||||||
register_globals = Off |
php_flag register_globals Off |