Jump to content

Slightly different hit counter


joecooper

Recommended Posts

Hi,

 

I have this code for a hit counter:

 

$query = mysql_query("SELECT * FROM games WHERE id=$id");
$row = mysql_fetch_assoc($query);
$updateplays=$row['plays'] + 1;
$query = "UPDATE games SET plays = '$updateplays' WHERE id = '$id'";
mysql_query($query) or die('Error, query failed');

 

it works well, adds a number everytime the page is viewed. is there a way to make it wait 10 seconds and then add's 1 to the counter?

 

the reason is so it will count only people spending time on the page.

 

 

Link to comment
https://forums.phpfreaks.com/topic/123258-slightly-different-hit-counter/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.