<?php mysql_query("UPDATE game SET hits=hits+1 WHERE id=2 ") or die (mysql_error()); ?>
I have that code on one page ( it is osmething like counter) but when the page load in Firefox
the hits are increasing with 2 instead 1
in IE and Opera it is workin fine
Why?????????????????????????
Please Help me
Moderator: General Moderators
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: Please Help me
I suggest the answer lies elsewhere - are you using Javascript to control the loading and redirection of pages for example? It sounds as though something [that does not conform to standards] is forcing Firefox to load the pages twice, or perhaps in fact Firefox is doing what it should be doing and the others are ignoring certain instructions?
Re: Please Help me
I use javascript but nothing with redirects or something like that. I tryed without javascript and still the same
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: Please Help me
If it's a variant of a counter you are recording then perhaps you could record the IP address and date of each hit and disallow further hits from the same IP on the same day?
Where of course NewVisitor() is a function you would write that returns true/false appropriately, and - before it returns a true value - adds the $visitorAddr and $dateVisited to a database table or plain text file, or whatever.
Code: Select all
$visitorAddr = $_SERVER['remote_addr'];
$dateVisited = date(zy);
if (NewVisitor($visitorAddr, $dateVisited))
{
$counter++;
}