By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,192 Members | 1,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,192 IT Pros & Developers. It's quick & easy.

How to get client IP ?

P: n/a
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

May 26 '06 #1
Share this Question
Share on Google+
11 Replies


P: n/a
David Velazco wrote:
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.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 26 '06 #2

P: n/a
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
My site is hosted on W2003 server SP1, IIS, ISA

I'm only using ASP no ASP.NET


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 26 '06 #3

P: n/a
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


"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.242...
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
My site is hosted on W2003 server SP1, IIS, ISA

I'm only using ASP no ASP.NET


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

May 26 '06 #4

P: n/a
This is everything you will be able to retrieve from the server
variables if you run this script and cant find what your looking for
then its un ava to you for some reason.

http://www.4guysfromrolla.com/webtech/092298-3.shtml

Hope this helps.

Earl Robb
www.jhdesigninc.com

May 26 '06 #5

P: n/a

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.242...
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.

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


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

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
My site is hosted on W2003 server SP1, IIS, ISA

I'm only using ASP no ASP.NET


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

May 27 '06 #6

P: n/a
Slim wrote on 27 mei 2006 in microsoft.public.inetserver.asp.general:
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


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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 27 '06 #7

P: n/a

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.242...
Slim wrote on 27 mei 2006 in microsoft.public.inetserver.asp.general:
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


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

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

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

May 27 '06 #8

P: n/a
> 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" <me@here.com> wrote in message
news:Ov**************@TK2MSFTNGP03.phx.gbl...
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.242...
Slim wrote on 27 mei 2006 in microsoft.public.inetserver.asp.general:
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


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

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

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


May 27 '06 #9

P: n/a

"Kyle Peterson" <ky*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
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...

Try using the server admin with host headers



"Slim" <me@here.com> wrote in message
news:Ov**************@TK2MSFTNGP03.phx.gbl...

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.242...
Slim wrote on 27 mei 2006 in microsoft.public.inetserver.asp.general:

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

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

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)



May 27 '06 #10

P: n/a
It all works fine for me, you just need to know what your doing.


"Slim" <me@here.com> wrote in message
news:On**************@TK2MSFTNGP05.phx.gbl...

"Kyle Peterson" <ky*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
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...

Try using the server admin with host headers



"Slim" <me@here.com> wrote in message
news:Ov**************@TK2MSFTNGP03.phx.gbl...

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.242...
Slim wrote on 27 mei 2006 in microsoft.public.inetserver.asp.general:

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

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
I suppose the OP would have to use another server as an intermediate,
but I
would have to sleep on it getting a solution.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)



May 27 '06 #11

P: n/a
David Velazco wrote:
I wish I have the number IP of client.
How do i make it ?


You can wish all you want, but realizing that wish is an actual
impossibility. The notion of "IP Address" is meaningless when the client is
behind a proxy or NAT. There are probably hundreds of thousands of computers
with [192.168.0.2] or [10.0.0.2].
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
May 28 '06 #12

This discussion thread is closed

Replies have been disabled for this discussion.