Google
 
Web wholesale-suppliers.net

Welcome to The Online Computer Information Library

The Online Information Library gives you an inclusive collection of Computer Informational Articles
discussing Computer Hardware, Computer Software, Technological Advances and more

Find a visitor's IP Address with ASP
By Sven Vdhrison

 

Do you want to know the IP address of a visitor? This can be useful for many reasons, such as tracking site usage or blocking access to specific people. Here's how you can find it.
Level: Beginner

In an ASP page, within the ASP tags, , you can retrieve the IP address of a user through the ServerVariables collection of the Request object. To do this, you use the code Request.ServerVariables("REMOTE_ADDR").

Display The IP Address
So, if you want to display the IP Address to the user then the following page will suffice:

Exploring Request.ServerVariables
You might be wondering what other information you can get from Request.ServerVariables, well you can find out with the following script which displays all the variables in it along with their values if set, in a HTML table:
<%@language="VBScript"%>
<table border="1">
<tr><th>Variable</th><th>Value</th></tr>
<%
Dim variable
For Each variable In Request.ServerVariables
   Response.Write "<tr><td>" & variable & "</td>"
   Response.Write "<td>" & Request.ServerVariables(variable) & "</td></tr>"
Next
%>
</table>
vdhri.net is a website dedicated to providing free lessons and tutorials in many programming languages.


Wholesale Distributors Home - About The Wholesale Distributors Registry- Contact The Wholesale Distributors Registry -
FAQs
- Login - Resources - For Wholesalers - Terms and Conditions
Copyright © 2006 Wholesale Registry International, LLC. All rights reserved