Kiss those Spammers GoodBye!

Version: 12
Revision: 32 Build 11a

Kiss those Spammers GoodBye!


Introduction: When I was reading my favorite book, my “Compaq PDA” notified me for new readers who is / are commenting on my blog. But, what is annoying, most of these spammers are just a pain in the neck! They don’t know where to stop and they never gave other readers and myself any good comments or advice. All I’ve seen is rubbish comments that contains dangerous links and contents that are ridiculously useless!

So, from now on, if you want to be block these idiots, than look no further! Just add all of your nightmares into a text file and let the script block the numskull!
Also, if you are not a whiz in HTA script, you can use this as an alternative. No messing around with php, either!

Notes: this tutorial is only for WordPress publisher and php user. Any other platforms that uses HTML, it will not work, unless, you made your server run like a hybrid engine.
To do this, you must consult this situation with your hosting provider.

1.] Copy this script and put it to your “header.php” file. However, it must be placed in – between your ‘header’ tags. Just choose one of these script and enjoy yourself…

Notes: the first script will “print” a notice for your Spammers.
Although, it’s a little funny when they see that.

The second script will redirect all spammers to Google!
Happy spamming…

<?php
$deny_ips = file('ip.txt',FILE_IGNORE_NEW_LINES);
$ip = isset($_SERVER['REMOTE_ADDR']) ? trim($_SERVER['REMOTE_ADDR']) : '';
if (($i = array_search($ip, $deny_ips)) !== FALSE){
print "Your IP address ('$ip') was blocked!";
exit;
}
?>
<?php
$deny_ips = file('ip.txt',FILE_IGNORE_NEW_LINES);
$ip = isset($_SERVER['REMOTE_ADDR']) ? trim($_SERVER['REMOTE_ADDR']) : '';
if (($i = array_search($ip, $deny_ips)) !== FALSE){
header("Location: http://google.com");
exit;
}
?>

2.] Save your progress and upload a text file with the correspondent IP addresses.
It must be written like this without white spaces.

321.21.1.1
23.122.12.2
91.214.45.89
77.222.131.40


Notes: you will only need to write one IP addresses – per line. Also, the file must be uploaded as: “ip.txt”. If not, just change your file-name from the php script and make it synchronize!

3.] Next, you will need to block hackers and spammers from looking at your text file.
All you need to do is add this script – straight into your HTA file. After that, just save it and upload it to your server.

Notes: you must delete your old “htaccess” file, just before uploading your new version.

<Files ip.txt>
  order allow,deny
  deny from all
</Files>

4.] Done!

When you have a new spammer / hacker, you can add your offender into a text file.
Easy as a cow, flying over a fence!

Copyrighted By Lair360

Comments are closed.