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
#3
How to block user after insert wrong password 3 times for 15 minutes using php any code or tutorial any idea??? I don't want to block him based on ip address I need other ways
Reply
#4
(06-21-2017, 10:26 AM)Sarahrose Wrote: How to block user after insert wrong password 3 times for 15 minutes using php any code or tutorial any idea??? I don't want to block him based on ip address I need other ways

In-order to do that, You have to create cookie of the user. You can create cookie by using PHP or Javascript. Once the user tries to log in the cookie must be increment to 1, second time to 2. Third time he must be blocked. You can add a condition using PHP or Javascript. If the cookie is set to 3, then add a redirect to index page or a page that you want to show. If you have any doubts just replay.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)