24
Nov

Display Users IP Address

Instructions:

1. The file extention must be ".shtml"

2. Your server must support ssi, contact your host to find out if ssi is supported.


3. File must be uploaded to a server to test.

Snippet:-


<script>
// gets ip address "DO NOT DELETE"
var IPAddress = '<!--#echo var="REMOTE_ADDR"-->';
 
// title bar display, delete if you do not want the IP in the title bar
document.write("<title>Title Bar Display, Your IP is: "+IPAddress+"</title>");
 
// status bar display, delete if you do not want the IP in the status bar
window.defaultStatus = "Status Bar Display, Your IP is: "+IPAddress;
 
// Alert Box, not needed, delete if you do not want an alert box to show up
alert("Alert Box, Your IP is: "+IPAddress);
 
</script>

Working example: HERE

Permalink | Comments (0) | Post RSS