Obtain the real IP address of the user in ASP.

Source: Internet
Author: User
Tags servervariables

When I used to work for an e-commerce website, because the website sells virtual things, such as game recharge cards or something, online payment is supported. Over time, there will inevitably be a lot of people who want to attack the website. Some boring people always use the proxy to attack the website. In this way, even if we know that the website has been attacked, we will not be able to attack the other party, later I found the request in ASP. servervariables ("http_x_forwarded_for") can get the user's proxy IP address. If the user uses a proxy, this value will not be blank. Otherwise. Haha
Then, we can check whether the user's proxy IP address is blank during webpage loading. 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
In this way, if someone wants to destroy your website, he must use his own real IP address. But generally, people do not dare to use real IP addresses 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.