The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

ban ip script?

3 posters

Go down

In progress ban ip script?

Post by pety55 January 10th 2013, 11:57 pm

Is there any ban ip or block then redirect to another site. i found this javascript code but i doesn't know where i must put it
because i tried it on descripton and they can't put all words because of maxium words.

here is a script
<script type="text/javascript">

var bannedips=["84.108.43.133", "11.11.11.11"]

var ip = '<!--#echo var="REMOTE_ADDR"-->'

var handleips=bannedips.join("|")
handleips=new RegExp(handleips, "i")

if (ip.search(handleips)!=-1){
alert("Your IP has been banned from this forum")
window.location.replace("http://crystaldekaron-ban.99k.org/")
}

</script>
avatar
pety55
New Member

Posts : 14
Reputation : 1
Language : Croatian

Back to top Go down

In progress Re: ban ip script?

Post by SLGray January 10th 2013, 11:58 pm

Try an announcement that is on all pages.


ban ip script? Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51464
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: ban ip script?

Post by pety55 January 11th 2013, 6:47 pm

not work
avatar
pety55
New Member

Posts : 14
Reputation : 1
Language : Croatian

Back to top Go down

In progress Re: ban ip script?

Post by Sanket January 11th 2013, 7:15 pm

Modules>Javascript Codes Management
Enable Javascript code management : Yes
Add the javascript.
Code:
var bannedips=["84.108.43.133", "11.11.11.11"]

var ip = '<!--#echo var="REMOTE_ADDR"-->'

var handleips=bannedips.join("|")
handleips=new RegExp(handleips, "i")

if (ip.search(handleips)!=-1){
alert("Your IP has been banned from this forum")
window.location.replace("http://crystaldekaron-ban.99k.org/")
}
Placement: Check all the pages.

See if it works.
Sanket
Sanket
ForumGuru

Male Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum