Obtain users IP address?

J

jason

How does one capture the IP address of the user ....and...is there anything
'unique' you can do with this info besides knowing the ip number of his
domain/browser?

Thanks
Jason
 
E

Evertjan.

jason wrote on 31 aug 2003 in microsoft.public.inetserver.asp.general:
How does one capture the IP address of the user

IP = request.servervariables("remote_addr")
....and...is there
anything 'unique' you can do with this info besides knowing the ip
number of his domain/browser?

No, it could very well be the IP of a proxy or of a dial-in modem

But if you have a fixed IP yourself, you van very well do something special
like excluding yourself from public counters:

<% If request.servervariables("remote_addr") <> "123.123.123.123" then %>
..... clientside public counter code, like http://www.nedstatbasic.net/ ..
<% End If %>
 
A

Adrienne

How does one capture the IP address of the user ....and...is there
anything 'unique' you can do with this info besides knowing the ip
number of his domain/browser?

Thanks
Jason

Request.Servervariables("REMOTE_ADDR") - will give you the IP
Request.Servervariables("USER_AGENT") - will give you browser (User Agent)
information.
Request.Servervariables("HTTP_REFERER") - will give you the page/site the
person came from
Request.Servervariables("URL") - will give you the name of the page

There are all kinds of things you can do with this information, like roll
your own stats, if you don't have access to raw server logs.

You can also do rudimentary browser sniffing. For example, IE does not
support position:fixed so you can serve IE a style sheet that uses
position:absolute instead. But, please do not use browser sniffing to do
something silly like "You have to use IE to view this site".
 

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

Forum statistics

Threads
474,085
Messages
2,570,597
Members
47,218
Latest member
GracieDebo

Latest Threads

Top