What considerations should be made when programming with register globals on/off in PHP?
When programming with register_globals set to on in PHP, it poses a security risk as it allows external variables to overwrite the values of your script's variables. To mitigate this risk, it is recommended to turn off register_globals in the PHP configuration or use superglobal arrays like $_GET, $_POST, and $_REQUEST to access variables.
// Set register_globals to off in php.ini or .htaccess file
// or use superglobal arrays to access variables
$myVar = $_GET['myVar'];
Related questions
-
PHP database delete
-
PDO drivers PHP applications
-
Ternary operator PHP code readability