Okay, so I was wondering if this code is correct for showing the bots (eg: googlebot, etc...) on a website, or if it is wrong in some way. If you have other code that is guaranteed to work, please post it. This is for a friend of mine, and I'm trying to help him out a little bit.
<?php
$bot_list = array("Inktomi Slurp", "Googlebot", "Scooter", "MSNBot", "Ahoy! The Homepage Finder", "The Jubii Indexing Robot", "AskJeeves", "AbachoBOT", "KIT Fireball");
function detect_bot() {
global $bot_list;
foreach($bot_list as $bot) {
if(ereg($bot, $_SERVER['HTTP_USER_AGENT'])) {
$thebot = $bot;
}
}
if ($bot) {
print " Bots visiting site now: $thebot";
}
}
?>
Thanks, SuperMario290