Djrikidk Posted May 3, 2010 Share Posted May 3, 2010 Hi everyone! I need some help with this logout script i am making. The logout thing is working fine, it logs the user out nice and smooth when you click on the log out link. But now i want it to log the user out after 20 minutes of inactivity, i've searched on Google and found some pretty nice scripts for that, but the problem is that when an user logs out a value in my Database changes so the user will be displayed as offline. I would like to execute a query after those 20 minutes of inactivity! So basicly, i need a script that can execute some code after some time of inactivity. I need help!! If possible i would also like to make the timer keep counting even if the user closes the browser. Link to comment https://forums.phpfreaks.com/topic/200588-need-help-with-a-logout-script/ Share on other sites More sharing options...
Presto-X Posted May 4, 2010 Share Posted May 4, 2010 just as a quick concept, I would have the user table updated everytime the user loads a page with the time, then I would setup a cronjob to run and look at the user's activity times if it finds a time that is older than 20 minutes change their status from lets say 1 to 0. Link to comment https://forums.phpfreaks.com/topic/200588-need-help-with-a-logout-script/#findComment-1052785 Share on other sites More sharing options...
Djrikidk Posted May 4, 2010 Author Share Posted May 4, 2010 just as a quick concept, I would have the user table updated everytime the user loads a page with the time, then I would setup a cronjob to run and look at the user's activity times if it finds a time that is older than 20 minutes change their status from lets say 1 to 0. I forgot to say that i am pretty new at PHP and MySQL, so if you guys could give an example or something, it would be pretty nice! Link to comment https://forums.phpfreaks.com/topic/200588-need-help-with-a-logout-script/#findComment-1052875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.