Page 1 of 1

How To: determine next page visited?

Posted: Sun Aug 23, 2009 9:32 pm
by $Mike09
Looking to determine if next page visited is in root site, else log them out

eg root=http://www.site.com/

<?php
//Function
if ()
{
echo('<body onunload="logout.php"> ')
}
?>
Any ideas?
only because im holding an online count in mysql database, and it gets annoying when users dont click logout, even though sessions are detroyed.

Re: How To: determine next page visited?

Posted: Mon Aug 24, 2009 1:50 am
by requinix
Wrong solution.

Every time a user does something, update something in the database. Specifically, a field that tracks the last time they did something. Then the "online user count" becomes a "count of users who did something in the last X minutes".

Re: How To: determine next page visited?

Posted: Tue Aug 25, 2009 11:17 am
by $Mike09
Thanks anyways, correct solution for any others who have same problem./
http://www.devarticles.com/c/a/PHP/The- ... ith-PHP/1/

Re: How To: determine next page visited?

Posted: Tue Aug 25, 2009 1:17 pm
by requinix
$Mike09 wrote:Thanks anyways, correct solution for any others who have same problem./
http://www.devarticles.com/c/a/PHP/The- ... ith-PHP/1/
Same idea, except "the database" is the file system and the "field that tracks the last time they did something" is the last-modified date of the session file.