Display user's IP address when visiting internal site

J

JayPee

Here is my dilema. I'm running IIS on a Windows 2000 Proffessional PC.
I'm a running a small intranet site off this machine which is
accessible by the end users by typing in the computer name of this
machine. What I need is a script of any kind that will allow me to
capture the end users internal IP address and display it on the status
bar of their IE window (Bottom left). Again, the only people accessing
this site are internal users and I want them to see what their IP
address is whenever they access the main page of the site. Is this
possible? Any help is appreciated.

-Jorge
 
D

Dom Leonard

JayPee said:
I'm running IIS on a Windows 2000 Proffessional PC.
I'm a running a small intranet site off this machine which is
accessible by the end users by typing in the computer name of this
machine. What I need is a script of any kind that will allow me to
capture the end users internal IP address and display it on the status
bar of their IE window (Bottom left). Again, the only people accessing
this site are internal users and I want them to see what their IP
address is whenever they access the main page of the site. Is this
possible?

Assuming the main page is an ASP page (or can be made one) and tested
for 127.0.0.1 only, in the head section include:

<script type="text/javascript">
var sIpAddress = "<%= Request.ServerVariables("REMOTE_ADDR") %>";
window.defaultStatus = sIpAddress;
</script>


FWIW,
Dom
 
S

Stephen

Hi there

[posting sequence restored]
esrkq said:

Warning !!
Please Note !! This is really a server-side solution, similar to the
already-mentioned ASP solution. This solution only works if the SERVER
supports and implements server-side includes. This isn't really a
javascript solution, per se. (ie, it isn't *javascript* that is
detecting the IP number! (true also of the ASP solution) Plus, what's
displayed isn't really my machine's IP number anyway. But that probably
won't be an issue in the OP's scenario)

If you're using IIS, it's probably better to use the ASP version, IMO.
Regards,
Stephen
 

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,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top