Request. servervariables ("http_referer") Prevent download leeching

Source: Internet
Author: User
Tags servervariables
How request. servervariables ("http_referer") Works

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)

Request. servervariables ("http_referer") cannot be set properly:
1. Link from favorites
2. Click home or 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

Apparently, request. servervariables ("http_referer") cannot work normally in most cases. For this reason, we can make request only when downloading leeching. servervariables ("http_referer ").

For example:

Below isCodeFragment:
'Download the system URL list. Do not include http ://
Domain = "2ky.cn, 61.156.14.223 ″
Spldomain = Split (domain ,",")
Strreferer = request. servervariables ("http_referer ")
For IIi = 0 to ubound (spldomain)
If instr (strreferer, trim (spldomain (III)> 0 then ishttp = true
Next
If isnull (strreferer) or ishttp = false then
Response. write "the download link comes from illegal leeching. <a href =" http://www.2ky.cn/"> please go to the sharing century page and download it again. </A>"
Closedatabase
Response. End
End if

The download system URL list is the domain name or IP address used to access your download page. For example, you can use multiple URLs to access your download page, which can be separated by commas.

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.