Results 1 to 3 of 3
Oct 4, 2012, 22:02 #1
How to Get Login time history in PHP?
Need a perfect user data base solution for my ecommerce website. I want to track whole activity of my end user until the user logout
Thanks in Advance
Oct 4, 2012, 22:20 #2
Alright...and what is the question or problem you are having? Or are you wanting to use us as free labor once more? I would think judging by the link in your signature, that you would have the ability to develop such a system. :sLogic without the fatal effects.
All code snippets are licensed under WTFPL.
Oct 5, 2012, 01:51 #3
- Join Date
- Jun 2002
- 134 Post(s)
- 0 Thread(s)
This is very similar to providing a Who's Online component to a website, which consists of the following:
First you have to have a MySQL table, lets call it Sessions (or whatever you want to call it; with at least a session_id column and a last_activity_date column, you can add additional columns)
Next you INSERT a record into this table storing the session id of the user session_id() and a date/time stamp (using MySQL function NOW()).
As the browse your site you update that record's last_activity_date column.
At the same time, you have either a cronjob running or a second query run on every page that queries the Sessions table checking for a date/time stamp that is more than X minutes ago.
Example: session_id 123456 last_activity_date reports 2012-10-04 11:00:00 and it is now 2012-10-04 11:15:00, so 15 minutes have passed with no interaction.
Now do whatever you wanted to do with those records.