I have code for tracking time of visitor. I have the fillowing function:
PHP Code:
function olduser($visitID)
{
$now = time();
$visitData = getVisit($visitID);
if ( ! $visitData )
{ return newuser();}
$visitData ['totalClicks']++;
if ( ($visitData ['lastVisit'] + $GLOBALS ['slength']) > $now)
{
$visitData ['totalDuration'] += ($now - $visitData ['lastVisit']);
}
else
{
$visitData ['numVisits']++;
}
$visitData ['lastVisit']=$now;
updateVisit ($visitData);
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --