Here is the code that I have to a hit counter on my site, the problem is I'm having issues trying to get it to stop recording the hits with each refresh, I only want the hit to be recorded AFTER the page has been closed and then reloaded, not on refresh....any ideas?....thanks in advance.
the code I have:
$vlog = "hits.dat";
$fp = fopen($vlog, "r") or die("Cannot open to read $vlog!");
$count = fgets($fp, 1024);
$count += 1;
echo ("<font style='color:#000000;font-size:22px;background-color:#99ff99;'>");
echo ("$count Visitors");
$fp = fopen($vlog, "w") or die("Cannot open to write to $vlog!");
Create a session variable after your hit counter code and wrap your hit counter code in a conditional region where if session isset then don't update the counter.
Thank you for your response, I feel a little embarrased that I don't recall exactly how to do that, could you elaborate a bit more?