Problem:
how to check if visitor is a robot or bot?Solution:
Please use below codeExample:
$user_agent='';if( !isset( $_SERVER['HTTP_USER_AGENT'])){
echo 'i m a Robot!';
die();
} else {
$user_agent=strtolower($_SERVER['HTTP_USER_AGENT']);
}
$robot='N';
if(strpos($user_agent,'bot')>0 || strpos($user_agent,'Bot')>0) {
$robot='Y';
}
if($robot!='Y')
echo 'I am not a Robot';
else
echo 'I am a Robot';
0 comments:
Post a Comment