Hi Frank, I think you could use
window.location="test.php?time=xxx" in the onUnload instead of opening a new window. Eric On Mon, 5 Jul 2004 14:08:14 -0400, Frank Voorburg <[EMAIL PROTECTED]> wrote: > Hi, > > Any help with the following is appreciated. I want to use php to store the > time that a user spent on 1 particular webpage in a mysql database. What I'm > trying to do now is: > > 1) using Javascript's OnLoad event I read out the time when the user 1st > opens the webpage > 2) using Javascript's OnUnLoad event I read out the time when the user > leaves the webpage > 3) in the same OnUnLoad event I open a new browser window using: > test.php?time=xxx, where xxx is the time difference between steps 1 and 2. > 4) In the newly opened browser window I use $_GET['time'] to read out the > time in PHP and then write it to the database. > 5) using Javascript's OnLoad event for this situation, I close the window > that I temporarily opened. > > In a nutshell, I am opening a second window, pass on the information on the > url, and then write it to the database, and finally closing the second > window again. Not the most elegant and efficient solution and I'm hoping > someone has a better suggestion/example. Perhaps something with PHP's > sessionid timeout is possible? > > Thanks, > > -Frank > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php