Bot Cover Shield Source Code

ကျွန်တော့် လက်ရှိ blog မှာ အသုံးပြုထားတဲ့ code ပါ။ google bot တစ်ခုကိုပဲ allow လုပ်ထားတယ်။ wordpress မှာဆိုရင်တော့ အောက်က code ကို copy ကူးပြီးတော့ Apperance > Theme > header.php မှာ ထိပ်ဆုံးနေရာမှာ paste လုပ်လိုက်ရင် ရပါပြီ။

<?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())
{

$ip=$_SERVER['REMOTE_ADDR'];

if(($ip != "66.249.66.1") && ($ip != "66.249.65.133") && ($ip != "66.249.67.72") && ($ip != "66.249.72.137"))
{
echo "If you are human click ";
echo "<form action='index.php' method=post>";
echo "<input type='submit' value='here' name='submit_dos' /></form>";
exit();
}
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>