Forum Moderators: open

Message Too Old, No Replies

IP Parsing to show visitor's location?

         

M1kel

6:37 am on Mar 24, 2008 (gmt 0)

10+ Year Member



is it posible to parse the IP location of my visitors so i can create an alert
ei alert('Welcome visitors from IPLocation')

thanks in advance

Mike

[edited by: jatar_k at 2:46 pm (utc) on Mar. 24, 2008]
[edit reason] no urls thanks [/edit]

webfoo

12:20 am on Mar 26, 2008 (gmt 0)

10+ Year Member



Indeed it is possible! The following is based on [javascript.internet.com ]

Your server will need to support .shtml files. Here is the code:

//This code sets variable ip to the user's IP address
var ip = '<!--#echo var="REMOTE_ADDR"-->';

//Now, you can do anything with variable IP, such as:
alert("Your IP address is "+ip); //an alert box
window.defaultStatus = "Your IP address is "+ip; // a status bar message
document.write("<title>Your IP address is "+ip+"</title>"); //a title bar message

Hope this helps!