In short, HTTP Referer is part of the header. When a browser sends a request to a Web server, it usually carries a referer to tell the server from which page the link is sent, the server obtains some information for processing.
For example, if a user is linked to a friend on my homepage, his server can calculate from HTTP Referer how many users click the link on my homepage to access his website every day. The Referer should be an English word referrer, but there are too many people who misspelled the Referer, so the people who write the standard will be wrong. Request. servervariables ("http_referer") usage (Anti-external connection ).
In the following cases, the request. servervariables ("http_referer") is obtained from the address bar of the browser:
1. directly use <a href>
2. Form submitted with submit or <input type = image> (post or get)
3. Form submitted using JScript (post or get)
Next let's take a look at the situations where the request. servervariables ("http_referer") cannot be set properly:
1. Link from favorites
2. Click 'homepage' or a custom address.
3. Use location. href or location. Replace () of JScript ()
4. Enter the address in the browser.
5. <% response. Redirect %>
6. <% response. addheader %> or <meta http-equiv = Refresh> redirect
7. Load the address in XML
How request. servervariables (http_referer) Works
The method for obtaining Referer in JSP is: request. getheader ("Referer ");
In PHP, you can obtain a referer by: $ _ server ['HTTP _ referer'];
The method for obtaining a referer in ASP is: request. servervariables ("http_referer ")
Turn: http://www.cnblogs.com/ly312/archive/2011/02/23/1962052.html