kratsg Posted October 13, 2007 Share Posted October 13, 2007 What we're to be doing is implementing a referral type program on the site. Assume the following, Person A refers Person B to the site, it's stored in the database that Person B's referrer is Person A. So then, for each second Person B is on the site, we add one point to Person A's referral points (also set in the database). How can we track the user accurate enough (to the seconds) so that once Person B leaves the site, we know exactly when Person B closed the browser/went somewhere else, how long Person B was on the site, and simply use that info to give Person A his deserved referral points. We have access to our php.ini file for w/e reason, we've got database access, we can basically do anything w/ php, and such. Any ideas on how to do this? My only idea at the moment was to check every 5 minutes who was active in the past 5 minutes, and clear anyone who wasn't, but that didn't seem accurate. Quote Link to comment https://forums.phpfreaks.com/topic/73115-track-the-time-a-user-is-on-a-website/ Share on other sites More sharing options...
mattal999 Posted October 13, 2007 Share Posted October 13, 2007 that is basically the best way to do it... do a check every 5 minutes or so and delete the accordingly and add the accordingly... i have no idea how to do that but it does seem the most appropriate way. Quote Link to comment https://forums.phpfreaks.com/topic/73115-track-the-time-a-user-is-on-a-website/#findComment-368732 Share on other sites More sharing options...
kratsg Posted October 13, 2007 Author Share Posted October 13, 2007 See, that's actually my problem. There's soo many things that could happen. Say a user is on the same page for a while, so after 5 minutes, they're considered to be logged off. Then if they move, they are 'on' again... It doesn't seem to be a way to check whether they navigate off or something? It'd be nice to have something more accurate. Quote Link to comment https://forums.phpfreaks.com/topic/73115-track-the-time-a-user-is-on-a-website/#findComment-368758 Share on other sites More sharing options...
kratsg Posted October 13, 2007 Author Share Posted October 13, 2007 BUMP (sorry, nobody's answered it yet) Quote Link to comment https://forums.phpfreaks.com/topic/73115-track-the-time-a-user-is-on-a-website/#findComment-368856 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.