sugan Posted November 26, 2007 Share Posted November 26, 2007 Hi,I want to know is there is any option in php to find page how many minutes i was in the page.Sugan Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted November 26, 2007 Share Posted November 26, 2007 Umm, do you mean... PHP code to find out how long I was on a specific webpage?If you want to do that, have them be logged on, and use a timestamp for them. I don't know the code offhand but I'll get back to you on that. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 26, 2007 Share Posted November 26, 2007 You can use Javascript, you can have a Javascript function run on load that records when the page was loaded, and have another function run on unload that records the difference between the current time and when the page was loaded. You can use AJAX if you want to save that information somewhere. Link to comment Share on other sites More sharing options...
sugan Posted November 27, 2007 Author Share Posted November 27, 2007 Hi,Can any body give a code for it in javascript.Regards,Sugan Link to comment Share on other sites More sharing options...
Synook Posted November 27, 2007 Share Posted November 27, 2007 Something like var time;window.onload = function() {now = new Date();time = now.getTime();}window.onunload = function() {now = new Date();timespent = now.getTime() - time;minutes = timespent /1000 / 60;//Minutes is the number of minutes spentalert(minutes);} Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.