What is the difference between $_SERVER['PHP_SELF'] and $_REQUEST['PHP_SELF'] in PHP?

$_SERVER['PHP_SELF'] is a server variable that contains the filename of the currently executing script, while $_REQUEST['PHP_SELF'] is a request variable that can be manipulated by user input. It is generally safer to use $_SERVER['PHP_SELF'] as it is less susceptible to injection attacks. To avoid potential security risks, always validate and sanitize user input before using it in your code.

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