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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Saturngod

Subscribe now to keep reading and get access to the full archive.

Continue reading