What is the potential issue with using register_globals in PHP and how can it affect the functionality of a script?

Using register_globals in PHP can lead to security vulnerabilities as it allows user input to directly populate global variables, opening the door to injection attacks and unauthorized access to variables. To solve this issue, it is recommended to disable register_globals in the PHP configuration file (php.ini) and instead use superglobal arrays like $_GET, $_POST, and $_SESSION to access user input.

// Disable register_globals in php.ini
// Add the following line to php.ini:
// register_globals = Off