ASP Hosting sale!
1,000MB space, 40GB transfer, 1 SQL Server 2000 db! - $9.95 per month*!
Limited Time Offer!

aspdev | articles | tutorials | forums

ASPdev -> All Articles -> Get the IP address of your visitors in ASP?

Get the IP address of your visitors in ASP?

In ASP you can get the IP address of your users from the Request.ServerVariables collection. The following ASP script will display the visitor’s IP on the screen:

<% Response.Write Request.ServerVariables("REMOTE_ADDR") %>

Why would you want to know what are your visitors’ IPs? There are several reasons why you might need their IP, for example:

. You want to determine visitors’ geographical location and create geo-based statistics or you want to display different content depending on the IP (Google.com does that)
. You can use the user’s IP to create a unique cookie string and track your returning visitors or greet them appropriately.




Contact Us