What are the potential security risks associated with using register_globals in PHP scripts?

Using register_globals in PHP scripts can lead to security vulnerabilities such as variable injection attacks and overwrite of global variables. To mitigate these risks, it is recommended to disable the register_globals directive in the PHP configuration settings.

// Disable register_globals in PHP configuration settings
// php.ini file
register_globals = Off;