What are the potential security risks associated with using $PHP_SELF instead of $_SERVER['PHP_SELF'] in PHP?
Using $PHP_SELF instead of $_SERVER['PHP_SELF'] in PHP can pose a security risk as it opens up the possibility of a Cross-Site Scripting (XSS) attack. It is recommended to always use the $_SERVER superglobal array to access server variables in PHP to ensure data is properly sanitized and validated.
$php_self = htmlspecialchars($_SERVER['PHP_SELF']);