Problem ignoring search bots
Posted: Mon Jun 13, 2005 12:08 pm
Is this code correct?? Want i want to do is to ignore the google and yahoo bots from my web monitor statistics
So what i think this code is doing is:
1-. Get the browser
2-. If its google, do nothing
3-. If its yahoo, do nothing
4-. Complete the insert querys if it is not google or yahoo.
BUT, a minute a go a google bot came in and it didnt work...
Code: Select all
$browser = $_SERVER["HTTP_USER_AGENT"];
if(preg_match ("/Yahoo! Slurp/i", $browser)){;}
elseif (preg_match ("/Googlebot/i", $type)){;}
else {
sql_query("INSERT INTO $prefix"._monitor." VALUES (\"\",\"$mvname\",".time().",1,0,\"$ipuser \",\"$pais\",\"$urlactual\", \"$monreferer\", \"$browser\")", $dbi);
insertar($noref);
addPais($pais);
}
}1-. Get the browser
2-. If its google, do nothing
3-. If its yahoo, do nothing
4-. Complete the insert querys if it is not google or yahoo.
BUT, a minute a go a google bot came in and it didnt work...