IP Address ~ what html script can I include in my blog so the visitor can see their own IP Address?
I do not want to reference back to another web site.
2007-10-19T20:04:40Z
Imadoofu - I could not get that to work - the exact html would be great.
2007-10-19T20:30:16Z
Dave I tried
Your IP Address is <script type="text/javascript"> var ip = '<!-- #echo var="REMOTE_ADDR" -->'; </script> and it did not work - it looked blank.
♫DaveC♪♫2007-10-19T20:09:26Z
Favorite Answer
The above answer is only partially correct. This part:
<!-- #echo var="REMOTE_ADDR" -->
is called SSI (Server-Side Includes), requires no JavaScript, and has to be interpretted by the web server. Normally, SSI is not interpretted unless the document extension is .shtm or .shtml so, therefore, you will have to experiment to see what you'll get.
If you get the SSI to work then, as demonstrated, you can capture the SSI output and place it into a JavaScript variable:
<script type="text/javascript"> var ip = '<!-- #echo var="REMOTE_ADDR" -->'; </script>
However, this still may not work for your visitor if they happen to have JavaScript disabled in their browser.
I found this at http://javascript.internet.com/user-details/ip-address.html its javascript so you would just put it in <script> and </script> and then change whatever you want to say it in there var ip = '<!--#echo var="REMOTE_ADDR"-->'; don't know exactly how it works but I think that will give you a variable ip that is a string of the ip so you might be able to go
<p onload="var ip = '<!--#echo var=/"REMOTE_ADDR/"-->';document.write(ip);"> </p> but I dunno if that will work.
mutually as i think of that's achieveable to get a area from an IP handle, a random man or woman ought to probable purely hint the IP to the corporation which could provide you internet, yet i do no longer think of it is going greater effective than that. you are able to probable purely get a precise area from the corporation in case you have some severe count, like attempting to get information some legal or great crime.