What are the advantages and disadvantages of using PHP_SELF versus SERVER['PHP_SELF'] in form actions?

Using `PHP_SELF` directly in form actions can pose a security risk as it can be manipulated by attackers to execute malicious code. It's recommended to use `$_SERVER['PHP_SELF']` instead, as it provides a more secure way to access the current script name. This helps prevent potential attacks like cross-site scripting (XSS).

<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="post">
  // form fields
</form>