Page 1 of 1

Problem ignoring search bots

Posted: Mon Jun 13, 2005 12:08 pm
by danf_1979
Is this code correct?? Want i want to do is to ignore the google and yahoo bots from my web monitor statistics

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);
	}
}
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...

Posted: Mon Jun 13, 2005 12:10 pm
by danf_1979
LOL, what is that $type variable doing there... again LOL. Going to check again if it works now... sorry.

Posted: Mon Jun 13, 2005 2:06 pm
by danf_1979
Could anybody please connect to my web so i can check if the script process international hits? because -could be the day, but who knows- I suddenly have only national (Chile) hits.
the web is //LINK ERASED// Just to check. I will remove later the link.
Thank u.
And if u connect could you leave a message so i know someone did?? If the script dont get it, then its screwed up.
Thanks asgain.

Posted: Mon Jun 13, 2005 2:13 pm
by danf_1979
Thank u!! I got someone from this referer. Everyting working fine...

Posted: Mon Jun 13, 2005 5:13 pm
by shiznatix
glad we could be of service? :roll: