PHP real user vs Search Engine Crawler
While logging visitors keep in mind your site may be visited by Search Engine Crawlers too, to distinguish between Crawler and real user I have below function working for me well, although it may not be perfect or do not have complete list of all search engines be there are the most common and frequent crawlers visits the sites.
here is the code
function is_bot(){
$botlist = array("Teoma", "alexa", "froogle", "Gigabot", "inktomi",
"looksmart", "URL_Spider_SQL", "Firefly", "NationalDirectory",
"Ask Jeeves", "TECNOSEEK", "InfoSeek", "WebFindBot", "girafabot",
"crawler", "www.galaxy.com", "Googlebot", "Scooter", "Slurp",
"msnbot", "appie", "FAST", "WebBug", "Spade", "ZyBorg", "rabaz",
"Baiduspider", "Feedfetcher-Google", "TechnoratiSnoop", "Rankivabot",
"Mediapartners-Google", "Sogou web spider", "WebAlta Crawler","TweetmemeBot",
"Butterfly","Twitturls","Me.dium","Twiceler","bot","Bot");
foreach($botlist as $bot)
{
if(strpos($_SERVER['HTTP_USER_AGENT'], $bot) !== false)
return $bot;
}
return false;
}
$which_engine = is_bot();
//if false then it is real user







Visit Today : 173
Total Visit : 932530
Total Hits : 3547725308
Comments
how to use this function?!? where I must place this function in my page?
please help..