Web Hosting Talk







View Full Version : Code needed


ashokuh
11-19-2005, 10:07 PM
i have www.purohits.com.
I want a html or java code:

1.when someone visit my site, on my web page they should be shown from which ip Address/geographical location they are from?.


2..when someone visit my site, on my web page they should be shown date and Time GMT

Please any one know codes post it here or PM


Regards
Ashok

jamesyeeoc
11-26-2005, 08:31 AM
One simple IP address javascript (there are many variations) - Put this into the <BODY>:
if ((navigator.appVersion.indexOf("4.") != -1) && (navigator.appName.indexOf("Netscape") != -1)){
ip = "" + java.net.InetAddress.getLocalHost().getHostAddress();
document.write("Your IP address is " + ip);
}
else {
document.write("IP Address only shown in Netscape with Java enabled!");
}
// End -->
</script>For the date/time in GMT, see if the script at the following link is what you are looking for:
http://www.jsmadeeasy.com/javascripts/Forms/world_time/template.htm