Script To Block IP Addresses on Blogspot

9:24 PM

As I had promised in my earlier post to share a script to Block an IP Address or whole IP range on blogspot. Now after the successful testin...

As I had promised in my earlier post to share a script to Block an IP Address or whole IP range on blogspot. Now after the successful testing, The Script is ready for all blogspot bloggers. The script is developed and coded by Blogtechnics, Hence all right reserved by blogtechnics. But you can use this script on your blog. Please don't make any business use of this script without our permission. The installation of this script is very easy and there is only two steps to follow.
The script could block whole IP range or a particular IP address to accessing your blog. This is a full proof script and Afaik, there is no any way to crack this. This script is written in two parts, Then second one you have to paste on your template, and the first one you have to host on any .php supported web host. Because the first part of script is written is PHP language. And second part is used for calling the first script. I know this may be little tough who don't have much knowledge about Coding but If you follow each step carefully it could be finished in few clicks.
Copy the script in any notepad file, and change the IP Address 1IP Address 2, and IP Address 3, according to your need. Just add the IP address you want to block. If you want to block the whole IP range then just add the IP address like (202.195) and for a single IP address just add the complete IP address like (202.195.020.145). Means you can use wildcard for both 3rd and 4th octet. I have given only three IP address here (In script 1) but you can add as many as you want. Now Save As the file with nameBlogspotIPblocker.php . Now simply upload this file on any PHP supported web host. There are many free web host like (110Mb.com or Bytehost.com). Copy the URL of that uploaded file. remember the URL should end with .php extension, otherwise script would not work.
Script 1
<?php
/*
Blogspot IP address blocker. Provided by www.blogtechnics.com
*/
$iplist = array("IP Address 1","IP Address 2","IP Address 3"); // 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 BlogspotIPblocker.PHP in below script 2.
Script 2
<SCRIPT LANGUAGE='javascript' SRC='BlogspotIPblocker.php' TYPE='text/javascript'></SCRIPT>
Now you have to paste the script 2 in your blogspot blog. There are two methods to do that, both the methods are explained below.
1. Goto ->> Blogger ->> Design ->> Edit HTML. and simply copy and paste the above code (script 2) just before </head> tag.
2. Goto ->> Blogger -->> Design ->> Add a Gadget ->> HTML/Java Script. and paste thescript 2 code.
The Blocked IP users will only see the page as shown in below. And can't access any page of your blog.
Both the methods are trusted and working you can choose any one according to your connivance. If you feel any problem contact me. Please don't make any change in the script. If you want more simple solution of the script just tell me the IP you want to block, I will email the code according to your need. Just paste the code as explained in above two methods. and forget about hosting and editing script 1. For any help leave your comment. Keep Blogging!

No comments: