Hello.
I am trying to create a simple Hit Counter using Kohana3 and PHP. But when I load a page with it, it counts as 1-3 times (normally, the first hit 3, then 2, then 1).
The code I'm using:
$game = ORM::factory('game')
->find_by_slug($slug);
if(!$game->loaded())
{
$this->request->redirect('/',404);
}
$game->times_played++;
$game->save();
An example page: http://www.plugb.com/game/qrossfire EDIT: Number of times played is below description.
How can I solve this?
Thank you.
EDIT:
I've found some requests like this:
/game/qrossfire
Agent: facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
/game/stickmen-swat
Agent: facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
/game/qrossfire
Agent: MetaURI API +metauri.com