When using ASP for network programming, the "back to previous page" button is often used. Although the browser has the return function, it is necessary to set the return button to facilitate visitors. The method is simple. Add the following code where you need to add the return button:
<A href = "<% = request. servervariables (" http_referer ") %>"> return </a>
Note: What does referrer mean?
Referrer is the source page address, for example, you from the http://www.abc.com/1.htm "point a link to http://www.xyz.com/somepage.aspx, then for the later, the Referer is the http://www.abc.com/1.htm ".
1. Sometimes the document cannot be obtained using the above second red code. referrer. Obviously this is because of document. referrer may also contain "&", so I use JavaScript to encode urlcode before passing it to the server segment.
2. We need to get the search engine keyword in the URL, but a website like Google uses UTF-8 encoding for the keyword. If you get it using the request object in ASP, the result may be garbled. My solution is to first decode it using the decodeuricomponent function of JavaScript, and then pass it to the server.