What are the differences between `$_SERVER["REQUEST_URI"]`, `$_SERVER["SCRIPT_NAME"]`, and `$_SERVER["PHP_SELF"]` in PHP?

`$_SERVER["REQUEST_URI"]` contains the URI which was given in order to access the page, `$_SERVER["SCRIPT_NAME"]` contains the path of the current script, and `$_SERVER["PHP_SELF"]` contains the filename of the currently executing script. When using these variables, it's important to understand the differences in their values in order to properly handle URLs and form actions in your PHP scripts.

$currentURI = $_SERVER["REQUEST_URI"];
$currentScript = $_SERVER["SCRIPT_NAME"];
$currentFile = $_SERVER["PHP_SELF"];

echo "REQUEST_URI: $currentURI <br>";
echo "SCRIPT_NAME: $currentScript <br>";
echo "PHP_SELF: $currentFile <br>";