Request.ServerVariables (HTTP

Source: Internet
Author: User
Tags servervariables
Request|server The following conditions are normally obtained from the address bar of the browser request.servervariables ("Http_referer"):
1. Direct use of <a href>
2. Forms submitted with Submit or <input type=image> (POST or get)
3. Forms submitted using JScript (POST or get)

Let's take a look at the case where Request.ServerVariables ("Http_referer") is not properly evaluated:
1. Links from Favorites
2. Click ' Home ' or a custom address
3. Use JScript's Location.href or Location.replace ()
4. Enter the address directly in the browser
5.<%response.redirect%>
6.<%response.addheader%> or <meta http-equiv=refresh> steering
7. Load addresses with XML

Obviously, Request.ServerVariables ("Http_referer") is not working properly in most cases, let's look at an example:
Ref.asp
<%
Response.Write "came from:" & Request.ServerVariables ("Http_referer")
%>

Ref.htm
<%
Response.AddHeader "Refresh", "10; Url=ref.asp "
%>

<meta http-equiv= ' Refresh ' content= ' 10; Url=ref.asp ' >

<form Method=get action=ref.asp name=getform>
<input type=submit value= ' go there (get) >> ' >
<input type=image style= ' Cursor:hand ' >
</form><p>
Look at the results of what the above code will get.
<form method=post action=ref.asp name=postform>
<input type=submit value= ' go there (POST) >> ' >
<input type=image style= ' Cursor:hand ' >
</form><p>

<a href= ' ref.asp ' > Direct link </a><p>

<a href= ' # ' >javascript post</a>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.