Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-07-2005, 07:01 AM
php|help me
Unregistered

Posts: n/a

logout user after so many minutes

hey.
ive been on several website that deal with php coding etc..
and i need help with something which the others could not help me with...
well they wuldn't reply.
here is my code at the moment
[code:1:51841318c2]
<?PHP
/// this will show weather or not their online etc...
$online = dbquery("SELECT * `members` WHERE clan='yes' AND online='1'");
$members = mysql_num_rows($online);
echo "-- Members --";
if ($members == 1) {
echo "1 online";
}elseif ($members > 1) {
echo "$members online";
}else {
echo "0 online";
}

echo "<br/>";
$online = dbquery("SELECT * `members` WHERE clan='no' AND online='1'");
$users = mysql_num_rows($online);
echo "-- Users --";
if ($users == 1) {
echo "1 online";
}elseif ($users > 1) {
echo "$users online";
}else {
echo "0 online";
}
?>
[/code:1:51841318c2]
what will happen is the user will login and in the login it will send the number 1 to the database were there username and id is.

and the script above will display how many users are online
but the only prob i have is if they forget to logout and just close there browser it will not remove the 1 from the the database.
so i thought if u culd like set a timer so lets just say the user was on the same webpage for 5 min or more and hasn't done anything then he/she will be loged out and the database will update to 0 instead of 1.

i don't know if that is possible but if it is culd someone help me please
my friend said i shuld just use a javascript to update the 1 to a 0 wen they close their browser but if they have javascript disabled then the script won't work :/

thanks for anyhelp very much appreciated
Reply With Quote
  #2  
Old 09-10-2005, 05:49 AM
Mike2
Unregistered

Posts: n/a

should look into cookies or sessions...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
20 minutes after the hour. Guest001 General Chat 6 05-16-2010 07:02 PM
learn chinese in 5 minutes skinny killer Humor & Jokes 4 02-20-2008 12:38 AM
Install Vista in two minutes Chrispy General Chat 3 03-26-2007 12:14 AM
Five Minutes to Midnight Stalker61 Humor & Jokes 10 08-28-2004 06:44 AM
how to find minutes played TFD Espo Delta Force 1 09-30-2003 02:50 PM


All times are GMT -5. The time now is 02:46 PM.




Powered by vBulletin®