In a generic php script such as www.example.com/somewhat/myscript.php/somewhatelse?myvariable=whatever, following PHP constants will give following different results:
PHP_SELF | $_SERVER['PHP_SELF'] |
/somewhat/myscript.php |
PATH_INFO | $_SERVER['PATH_INFO'] |
/somewhat |
SCRIPT_NAME | $_SERVER['SCRIPT_NAME'] |
/somewhat/myscript.php |
REQUEST_URI | $_SERVER['REQUEST_URI'] |
/somewhat/myscript.php/somewhatelse?myvariable=whatever |