IP address

D

David

Hi
I'm trying to get remote ip address and local ip address
of the user (i.e. machine name) but i couldnt find out it.
however i can see the public remote ip address.here is
the little code that i have written..

<%
For Each Item in Request.ServerVariables %>
<tr>
<td><%= Item %></td>
<td><%=Request.ServerVariables(Item)%></td>
</tr>
<%
Next
%>

Any help would be appreciated...
Thanx in advance...
David
 
K

Ken Schaefer

You can't get the "machine name" using just the Request.ServerVariables()
collection. The browser never sends the machine name to your webserver.

Cheers
Ken


: Hi
: I'm trying to get remote ip address and local ip address
: of the user (i.e. machine name) but i couldnt find out it.
: however i can see the public remote ip address.here is
: the little code that i have written..
:
: <%
: For Each Item in Request.ServerVariables %>
: <tr>
: <td><%= Item %></td>
: <td><%=Request.ServerVariables(Item)%></td>
: </tr>
: <%
: Next
: %>
:
: Any help would be appreciated...
: Thanx in advance...
: David
 
B

Bhaskardeep Khaund

Hi, you can use

ip = Request.ServerVariables("REMOTE_ADDR")

you can get the server name as:-

servername = Request.ServerVariables("SERVER_NAME")

Hope this helps

Regards
Bhaskardeep Khaund

You can't get the "machine name" using just the Request.ServerVariables()
collection. The browser never sends the machine name to your webserver.

Cheers
Ken


: Hi
: I'm trying to get remote ip address and local ip address
: of the user (i.e. machine name) but i couldnt find out it.
: however i can see the public remote ip address.here is
: the little code that i have written..
:
: <%
: For Each Item in Request.ServerVariables %>
: <tr>
: <td><%= Item %></td>
: <td><%=Request.ServerVariables(Item)%></td>
: </tr>
: <%
: Next
: %>
:
: Any help would be appreciated...
: Thanx in advance...
: David
 

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
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top