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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.