How to get client IP ?

D

David Velazco

Hello Everybody,

I try to use script to get client IP

<%
dim IPAddr
IPAddr = Request.ServerVariables("remote_addr")
Response.Write("Your IP Address is " & IPAddr)
%>

but script return IP of Web site, not CLIENT and not null value!

My site is hosted on W2003 server SP1, IIS, ISA

I'm only using ASP no ASP.NET

Regards,
David
 
B

Bob Barrows [MVP]

David said:
Hello Everybody,

I try to use script to get client IP

<%
dim IPAddr
IPAddr = Request.ServerVariables("remote_addr")
Response.Write("Your IP Address is " & IPAddr)
%>

but script return IP of Web site, not CLIENT and not null value!

My site is hosted on W2003 server SP1, IIS, ISA
Have the user enter it into a form field. ;-)

There is no guaranteed way to do it.
 
E

Evertjan.

David Velazco wrote on 26 mei 2006 in
microsoft.public.inetserver.asp.general:
Hello Everybody,

I try to use script to get client IP

<%
dim IPAddr
IPAddr = Request.ServerVariables("remote_addr")
Response.Write("Your IP Address is " & IPAddr)
%>

but script return IP of Web site, not CLIENT and not null value!

This is not true.

The IP of the user's own pc or router or proxy is shown.

====================

This is the same question you, David, asked and I answered on:

Subject: Re: I want to get the number IP
Date: Mon, 22 May 2006 20:22:27 +0200
Newsgroup: microsoft.public.inetserver.asp.general
 
D

David Velazco

Hello Everybody,

My machine server give me a number IP but it's my server ISA that is my
firewall.
I wish I have the number IP of client.
How do i make it ?

I use this but it give me the same number.

<%
dim IPAddr
IPAddr = Request.ServerVariables("remote_addr")
Response.Write("Your IP Address is " & IPAddr)
IPAddr = Request.ServerVariables("remote_host")
Response.Write("Your IP Address is " & IPAddr)
%>

Regards,
David
 
S

Slim

Evertjan. said:
David Velazco wrote on 26 mei 2006 in
microsoft.public.inetserver.asp.general:


This is not true.

The IP of the user's own pc or router or proxy is shown.


Not if the web server is behind a ISA server, then it will show the ISA
server as the client
 
E

Evertjan.

Slim wrote on 27 mei 2006 in microsoft.public.inetserver.asp.general:
Not if the web server is behind a ISA server, then it will show the ISA
server as the client

Why would you do that? Is hiding a server a usefull idea?

I suppose the OP would have to use another server as an intermediate, but I
would have to sleep on it getting a solution.
 
S

Slim

Evertjan. said:
Slim wrote on 27 mei 2006 in microsoft.public.inetserver.asp.general:


Why would you do that? Is hiding a server a usefull idea?

ISA is very useful if you are hosting many web sites on one IP for example.
you can send requests to the web site based on the domain name entered.

Yes you can do this by using hostheaders in IIS, but that causes other
problems like connecting with visual studio though FrontPage extensions for
example


depending on what David wants to know the clients ip for, maybe ISA can do
the job for him.
ISA gives a log of client ip's, it can also block certain ip's, but if he
needs it for his asp code, hen I don't have a answer
 
K

Kyle Peterson

Yes you can do this by using hostheaders in IIS, but that causes other
problems like connecting with visual studio though FrontPage extensions
for example

ummm, no

I can do that no problem and my colocated 2003 Server is using host
headers...


Slim said:
Evertjan. said:
Slim wrote on 27 mei 2006 in microsoft.public.inetserver.asp.general:


Why would you do that? Is hiding a server a usefull idea?

ISA is very useful if you are hosting many web sites on one IP for
example. you can send requests to the web site based on the domain name
entered.

Yes you can do this by using hostheaders in IIS, but that causes other
problems like connecting with visual studio though FrontPage extensions
for example


depending on what David wants to know the clients ip for, maybe ISA can do
the job for him.
ISA gives a log of client ip's, it can also block certain ip's, but if he
needs it for his asp code, hen I don't have a answer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top