Saturday, May 12, 2012

How to Block IP addresses to Blogger?


A detailed steps on how to block range or specific IP's to blogger.  Though this is easy to install, you need to carefully read thoroughly to make this process done well. this, tutorial is adopted from blogtechnics
Here is steps on how to install:
1. Copy and save the scripts to notepad file(*.txt) format , and change the IP 1, IP 2IP 3IP 4  and so ford.  Simply add the IP addresses you wish to block. The IP to block should be like this "118.215.133.225" and blocking the range of IP it should type like this "118.215". All IP's starts from "118.215" will be blocked from entering your blogsite. You can add  IP's as many as you will.
2. Save As the file with name YourIPBlocked.php 
3. Now simply upload this (YourIPBlocked.php) file on any PHP supported web host. Free webhosting available in the net like  000webhost, 110Mb and Byethost, etc,. 
4. Next copy the URL of that uploaded file. (note: the URL should be in .php format, otherwise script fail to run.
<?php
$iplist = array(“IP 1“,”IP 2“,”IP 3“,”IP 4“); // the list of banned IPs
$ip = getenv(“REMOTE_ADDR”); // get the visitors IP address
// echo “$ip”;
$found = false;
foreach ($iplist as $value) { // scan the list
if (strpos($ip, $value) === 0){
$found = true;
}
}
if ($found == true) {
echo “top.location = “error.html”;n”; // page to divert to
}
?>


Now paste the URL of above file in the place of   YourIPBlocked.php  in below 2nd script. 



<SCRIPT LANGUAGE=’javascript’ SRC=’ YourIPBlocked.php ‘ TYPE=’text/javascript’></SCRIPT>


Now that you have your 2nd script, next is you have to paste the 2nd script in your blogspot blog. Simply follow the steps stated below. Two way to do that.
1. Login->> (now you are in dashboard)
2. Design ->> 
3. Edit HTML (note: check the "Expand widget Templates" then copy and paste the above code (2nd script) before </head> tag)

or:

1. Login->>
2. Design ->>
3. Add a Gadget ->>
4. HTML/Java Script (paste the 2nd script)

The Blocked IP users will only see the page as shown in below. And can’t access any page of your blog.

2 comments:

bloggy on July 15, 2017 at 9:15 PM said...

it's not working

joseph on September 13, 2019 at 4:48 PM said...

Click Text Here :17:

Post a Comment

 

Tags

Site Info

Followers

blogscenters Copyright © 2009 Blogger Template Designed by Bie Blogger Template