Click to See Complete Forum and Search --> : IP Ban - IP filter


|x|Solaris|x|
04-26-2003, 06:33 PM
Hey all, I am trying to put the following script on my website. I saved it as .shtml, uploaded it to my server, with my ip range. It does not work no matter what I do, any help. P.S. my ip is 66.82.9.34.

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
netscape = (navigator.appName.indexOf("Netscape") != -1);
version4 = (navigator.appVersion.indexOf("4.") != -1);

if (netscape && version4) {
ip = "" + java.net.InetAddress.getLocalHost().getHostAddress();
if (ip.indexOf("66.82.") >= -1)


{
alert("You are not permitted to access this site.");
history.go(-1);
}
}
// End -->
</script>
Thanks. Solaris

pyro
04-26-2003, 07:44 PM
You should do this server side, as you are not able to get the IP in the client side except in NN4 with Java enabled, I believe...