But how do I get into the database at the end when the user closes the browser? What function has the feature of being lastly called when the browser is closed, or when the user navigates away?
Am I left with "onunload" in combination with ajax, in order for me to update the database? can you give me more details on using the time() function?
This function gives me the current time (in seconds) when the page is loaded.
Let me run through the scenario to see how this is implemented...
the user visits:
pageA.php - call time() = 1 second, update database....
the user sits at pageA.php for 5 minutes = 5 X 60 = 300 seconds.
the user browses to pageB.php - call time() = 300 seconds, update database..
Then he closes the browser...how on earth would I call time() by then????