Getting user IP Address

G

Greg Smith

I have been using the following to get the client IP address:

Request.ServerVariables["REMOTE_ADDR"]

All of a sudden it has started returning

127.0.0.1 all the time. Does anybody have any idea why this would happen?



Any help is greatly appreciated.
 
G

Greg Smith

Yes.


Tampa .NET Koder said:
Are you running this site locally
http://localhost ??

Greg Smith said:
I have been using the following to get the client IP address:

Request.ServerVariables["REMOTE_ADDR"]

All of a sudden it has started returning

127.0.0.1 all the time. Does anybody have any idea why this would
happen?



Any help is greatly appreciated.
 
V

vMike

Greg Smith said:
I have been using the following to get the client IP address:

Request.ServerVariables["REMOTE_ADDR"]

All of a sudden it has started returning

127.0.0.1 all the time. Does anybody have any idea why this would happen?



Any help is greatly appreciated.
I use request.userhostaddress to get the ip address of the user.
 
G

Guest

If you are accessing the site from your own machine..I think this is the
address you should be getting. But, if you access this site from a remote
workstation, then you should see that remote workstation address. Other
than that, I don't have a clue what is wrong..I will defer this to someone
else
 
B

Ben Strackany

REMOTE_ADDR is the IP address of the user visiting the site.

If you are on the same machine as the site, and visit it via
http://localhost/blahblah, then your IP is locahost == 127.0.0.1.

In order to see something different from REMOTE_ADDR, you need to access the
site from a different machine.

--
Ben Strackany
www.developmentnow.com


Greg Smith said:
Yes.


Tampa .NET Koder said:
Are you running this site locally
http://localhost ??

Greg Smith said:
I have been using the following to get the client IP address:

Request.ServerVariables["REMOTE_ADDR"]

All of a sudden it has started returning

127.0.0.1 all the time. Does anybody have any idea why this would
happen?



Any help is greatly appreciated.
 

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

Top