/    Sign up×
Community /Pin to ProfileBookmark

IP Ban – IP filter

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

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@pyroApr 27.2003 — 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...
×

Success!

Help @_x_Solaris_x_ spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...