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.
|