So, on my arcade, howlingdoggames.com. I have a points system that gives you a point every time you visit a page with a game on, now, to reduce abuse of this, I would like
There is (mostly) no multithreading in PHP. You can sort of do this with forking processes on Unix systems but that's irrelevant because multithreading isn't really what you're after. You just want simple logic like this:
$now = time();
session_start();
$last = $_SESSION['lastvisit'];
if (!isset($last) || $now - $last > 45) {
$points = $_SESSION['points'];
if (!isset($points)) {
$points = 0;
}
$_SESSION['points'] = $points + 10;
$_SESSION['lastvisit'] = $now;
}
Basically only give the points if the increment between the last time you gave points is greater than 45 seconds.