Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Block a Specified Visitor Visit My Website or Blog
#1
Hello,

I am a web designer, and I am interested to know about blocking specified visitor visit my Website. Is there any solution for this?

I need to block the customer using Java-Script. I have the IP address of the visitors that I need to block.

I asked few of my friends. No one has the solution.

Please help me to get out from this problem.
Reply
#2
It is very easy to block user using Javascript.

PHP Code:
<script type="text/javascript">
// Enter The IP Address Of The Farud Click Users .... 
var bannedips=["23.23.23.23""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 site. Redirecting...")
window.location.replace("http://www.howi.in")
}

</script> 

On the above script, Enter the IP address which you need to block.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)