$_SERVERis an array of information such as header information (header), path, and script location (scripts locations), and so on.
Can be output in the background again
foreach ($_server as $key = $val)
echo "$key = $val <br/>";
See the HTTP protocol for two processing in the background. (the module in the background will encapsulate the accepted HTTP protocol two times.) In the output path, is the environment variable in the server. Key is the $REMOVE_ADDR value for the visitor's IP address. You can decide in the background to prohibit some IP visitors:
if ($_server[' remove_addr ']==192.168,1,100)
{
Do some processing, such as quitting directly, or jumping to another page
Page jumps are also part of the HTTP protocol
Header ("Location:somePage.php");
}
Generally use $_server[' document_root '] to obtain the path of the file in the server;
The specific parameters refer to the PHP manual (predefined variables).
2. Anti-theft chain reference
If you only want to visit the pages of this site, you can check the HTTP message body reference to determine, the following code
if (Isset ($_server[' http_referer '))
{
if (Strpos ($_server[' http_referer '), "http://localhost/www") ==0)
{
Description for site access to this site, you can continue to access
}
Else
{
Header ("Location:somePage.php");
}
}
The difference between 3.GET and post requests (there are other ways of requesting them, both of which are only common)
(1) The GET request is placed in the address bar. The POST request is placed inside the message body of the HTTP protocol.
(2) Size
The meaning of 4.header
The header is to write something into the HTTP message body, for example:
Header ("Location:somePage.php");
is to re-jump.
The status code returned to the browser is 302 instead of 200, so the jump happens to the client (browser).
5. Status Code
304 means the server did not update the file, and the file will no longer be sent to the browser.
PHP and HTTP protocol