Jump to content

php


sugan

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...