View Full Version : IP Banning........That Actually Works??
Phoenix
09-01-2002, 09:46 AM
Can someone please help me, i used a IP Banning script from javascriptkit and errors have shhown up on my page, in other words the script hasn't worked. Could someone on here send in a WORKING script or help with this one, I need it as soon as possible cause he is messing up me site. Thanks. :(
joh6nn
09-01-2002, 11:59 AM
what script were you using? can we see the page this is on?
Phoenix
09-01-2002, 01:00 PM
You can not see it on my site (www.e-gen.cjb.net or www.geocities.com/e_gen2000) but here is the script i am using, sorry for not displayin it earlier...........
<script language="javascript">
var ip = '<!--#echo var="REMOTE_ADDR"-->'
if (ip == '206.186.23.178') {
alert("STOP! You are viewing this page from an IP address that is not allowed!");
alert("Why can't you guys just leave me alone?");
if (confirm("Do you want to leave peacefully? Or will I have to help you?"))
{location.href="http://www.yahoo.com" } else { ("OK you choose I don't care! Bye bye! Don't come back!"); {location.href="http://www.yahoo.com" }} }
</script>
duniyadnd
09-01-2002, 01:17 PM
This won't help you in any way, but I thought I'd mention it, I read somewhere that on Dial Up connections, the PC's IP changes everytime. It stays static mostly on LAN and the like.
Love your site though, good luck.
Duniyadnd
redhead
09-01-2002, 01:32 PM
hmmm....
if you take a look at the script you'll see this line...
var ip = '<!--#echo var="REMOTE_ADDR"-->'
the "<!--#echo var="REMOTE_ADDR"-->" bit is in a language called SSI... meaning it cant be done in this way on servers like geocities. there are good tutorials on SSI on JavaScript Kit (http://www.javascriptkit.com), heres a method that might work and even then only in netscape...
<script>
<!--
// this script was based on one found
// on www.javascriptkit.com by Jon Eyrick
myAddress=java.net.InetAddress.getLocalHost();
ip=myAddress.getHostAddress();
if (ip=="0.0.0.0") // change this to a banned ip...
{alert('Your IP has been banned');
window.location="http://www.google.com/"}
//-->
</script>
this script was based on one from JavaScriptkit... but the author bunged it up with loads of credits rubbish that any pleb could remove... :rolleyes:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.