Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display local IP address on Intranet site

Status
Not open for further replies.

campbmb

Technical User
Apr 26, 2007
18
US
I would like to be able to display on an intranet page the local/internal IP address and the computer name of the user. But all the code I find is to display the external IP address. Does anybody know how to do this? Thanks in advance.
 
Maybe I didn't explain very well. When someone in the company goes to our intranet site, I'd like their local ip address and computer name to be displayed - just for them to see. It would be a fast way for IT (if working with the person on some problem) to have the person find the info (lots of computer illiteracy around here).
 
You'll need to use an ActiveX control, or maybe Javascript, to access the client PC and retrieve that information. As such, it falls outside the scope of this forum

Try the relevant forums for specific answers:

forum329
forum216



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
External IP means external to the webserver and what shows as the IP will depend on how the intranet server is accessed.

If the webserver is directly on the same LAN as the clients are, and they are accessing the server via it's NETBIOS name, LAN internal DNS alias or LAN IP then the IP shown will be the LAN IP of the client.
If the clients are on a different subnet or a remote location then it will be the router IP or the ISP/WAN IP that is displayed.
So "security risks" are minimal as the internal (LAN) IP will not be displayed if the server is accessed via its external interface.

If your server can run SSI you can use;

<!--#echo var="REMOTE_ADDR" -->

to display the IP of the client accessing the server.

Other than that, server side code can be used or as noted by vacunita, client side scripting can be used, in which case, it will always be the IP of the client browser that is shown.


Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top