Example:
1,http://localhost/aaa/(Open index.php in AAA)
Results:
$_server[' query_string '] = "";
$_server[' Request_uri '] = "/aaa/";
$_server[' script_name '] = "/aaa/index.php";
$_server[' php_self '] = "/aaa/index.php";
2,http://localhost/aaa/?p=222 (with inquiry)
Results:
$_server[' query_string '] = "p=222";
$_server[' Request_uri '] = "/aaa/?p=222";
$_server[' script_name '] = "/aaa/index.php";
$_server[' php_self '] = "/aaa/index.php";
3,http://localhost/aaa/index.php?p=222&q=333
Results:
$_server[' query_string '] = "p=222&q=333";
$_server[' Request_uri '] = "/aaa/index.php?p=222&q=333";
$_server[' script_name '] = "/aaa/index.php";
$_server[' php_self '] = "/aaa/index.php";
By example:
$_server["Query_string"] gets the query statement, in the instance, gets the following value
$_server["Request_uri"] gets the value after http://localhost, including/
$_server["Script_name"] gets the path to the current script, such as: index.php
$_server["Php_self"] The file name of the script that is currently executing
Get URL parameters