The real IP address of the user in ASP

Source: Internet
Author: User
Tags empty servervariables
IP address this is used to serve an E-commerce site, because the site's sales are virtual things, such as the game Recharge card ah what, Support online payment. Over time, there are a lot of people want to play the site's idea, some boring person is always using proxy Internet to attack the site, this way even if we know to be attacked also take each other no way, and later found in the ASP Request.ServerVariables ("Http_x_ Forwarded_for ") can get the user's proxy IP. If the user uses an agent, the value is not empty. Instead. Oh
Then, we can detect if the user's proxy IP is empty when the page is loaded. The procedure is as follows:

Usertrueip = Request.ServerVariables ("Http_x_forwarded_for")
If usertrueip <> "" Then
Response.Write "Based on the website itself and your personal data security, please do not use a proxy server"
Response. End ()
End If
This way, if someone still wants to destroy your website, he has to use his real IP to do oh. But the average person is afraid to use the real IP to attack others.




Related Article

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.