Bot Cover Shield

Today, I finished Bot Cover Shield with PHP. My blog ,, always occur CPU limit over and I think many bot come to my blog. So, I stop the bot and I just allow google bot. In Theory, Bot can’t save cookies (it may be use cookies but not sure). So, I am using saving cookies system.

[sourcecode lang=”php”] <?php if(isset($_POST[‘submit_dos’])) {     setcookie(“checkhuman”, “process”, time()+3600);     header(“Location:”.$_SERVER[‘HTTP_REFERER’ ]); } function chkcookies() {     if(isset($_COOKIE[“checkhuman”]))     {         if($_COOKIE[“checkhuman”]==”process”)         {             return true;         }         else         {             return false;         }     }     else     {         return false;     } } if(! chkcookies()) {


    if(($ip != “”) && ($ip != “”) && ($ip != “”) && ($ip != “”))     {         echo “If you are human click “;         echo “<form action=’index.php’ method=post>”;         echo “<input type=’submit’ value=’here’ name=’submit_dos’ /></form>”;         exit();     }

} ?> [/sourcecode]

I add this code in header.php of wordpress template. So, our blog can cover the bots easily.

comments powered byDisqus