How To: determine next page visited?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
$Mike09
Forum Newbie
Posts: 2
Joined: Sun Aug 23, 2009 9:23 pm

How To: determine next page visited?

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How To: determine next page visited?

Post 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".
$Mike09
Forum Newbie
Posts: 2
Joined: Sun Aug 23, 2009 9:23 pm

Re: How To: determine next page visited?

Post by $Mike09 »

Thanks anyways, correct solution for any others who have same problem./
http://www.devarticles.com/c/a/PHP/The- ... ith-PHP/1/
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How To: determine next page visited?

Post 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.
Post Reply