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.
How To: determine next page visited?
Moderator: General Moderators
Re: How To: determine next page visited?
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".
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?
Thanks anyways, correct solution for any others who have same problem./
http://www.devarticles.com/c/a/PHP/The- ... ith-PHP/1/
http://www.devarticles.com/c/a/PHP/The- ... ith-PHP/1/
Re: How To: determine next page visited?
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.$Mike09 wrote:Thanks anyways, correct solution for any others who have same problem./
http://www.devarticles.com/c/a/PHP/The- ... ith-PHP/1/