Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 5th, 2004, 08:19 AM
Registered User
Join Date: Jul 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to get IP Address of the User Machine

Hi All,

I want to get the IP Address of the system when and where the asp page execute.
Code will be appriciated.
A lot of thanx in advane to all

Old April 5th, 2004, 08:41 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

To get a visitors IP address
<% =Request.ServerVariables("REMOTE_ADDR")%>

find host name of client

There are many other server variables available.

Use the following code to see what all information can these server variables give you.

for each item in Request.Servervariables
response.write item & "=" & tempvalue & "<br>"

Hope that helps.


-Vijay G
Old April 10th, 2004, 01:44 PM
Authorized User
Join Date: Apr 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts

If you want skip cache-proxy server......
Dim Ip
Ip = Trim(Request.ServerVariables("HTTP_X_FORWARDED_FOR "))
If Ip = "" Then Ip = Trim(Request.ServerVariables("REMOTE_ADDR"))
Response.Write "Ip Adress: " & Ip



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get the IP address of the user viewing site crmpicco Perl 2 April 30th, 2007 06:51 AM
IP address of the user. 99mary BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 March 26th, 2007 09:23 AM
IP Address of a local machine Dilip Nagle Classic ASP Basics 1 September 29th, 2005 10:26 PM
Retreiving IP address & gateway address sjangit VBScript 0 February 3rd, 2004 02:02 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.