What modifications can be made to the $_SERVER['SCRIPT_NAME'] command to ensure proper functionality within a PHP login system?

The $_SERVER['SCRIPT_NAME'] command can be modified to use $_SERVER['PHP_SELF'] instead to ensure proper functionality within a PHP login system. This change helps prevent potential security vulnerabilities such as cross-site scripting attacks.

$script_name = $_SERVER['PHP_SELF'];