Hey.
Is there a way I can tell the difference between real visitors and bots, using php? I'm working on a stats script for my site, and would like to tell the difference between them.
Where do I start!?![]()
This is a discussion on separating Bots&Crawlers from real visitors? in the Shared & Semi-Dedicated forum
Hey.
Is there a way I can tell the difference between real visitors and bots, using php? I'm working on a stats script for my ...
Hey.
Is there a way I can tell the difference between real visitors and bots, using php? I'm working on a stats script for my site, and would like to tell the difference between them.
Where do I start!?![]()
Hmmm. I don't work with PHP but mod_rewrite has tools to identify and dump them. However, like anything, you'd have to define the rules to catch 'em.
Have you checked for a list of known bots? You might have to set up an array and match visitor user agent headers to the bot array values to allow/deny that visitor.
I don't know of any easy way to detect them, particularly if the header is forged. The bad bots, and the ones most detrimental to your site, won't want to identify themselves... assuming, of course, that they provide an agent header at all. Also, not all legitimate visitors pass complete headers either.
Sorry to be of so little help.
You use the UA (User Agent) filed in the headers. Here's a page I googled for ya:
http://danzcontrib.free.fr/en/pieges.php
Includes a php proggie you can dissect for your own porpoises.
Thanks
Now to work on the scrpt.
I don't wanna deny anyone (maybe 'bad crawlers' later on), just make a nice log/statistics script![]()
Yeah, I guessed you didn't want to deny folks, but the script gave you actual code to compare a list of bots to the UA in php, which should be darn close to what you need to do.
Get the list of UAs you want, stick'em into the array, compare against the UA and set a variable for use in the script that says this visitor is a bot, or not.
Good luck.
Short answer... no!
Last edited by Vin DSL; 01-30-2005 at 06:44 PM.
DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.
Here's the reason...
http://www.kloth.net/internet/badbots.php
Last edited by Vin DSL; 01-30-2005 at 06:45 PM.
DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.
Copyright © 2011 JaguarPC.com
Bookmarks