logoff user with php *urgent*

This is a discussion on logoff user with php *urgent* within the PHP Language forums, part of the PHP Programming Forums category; Hello, If somebody could help me with this one it would be very nice, the story: I need to check ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-02-2003
Spam sucks
 
Posts: n/a
Default logoff user with php *urgent*

Hello,

If somebody could help me with this one it would be very nice,

the story:
I need to check if a user is online or not at the moment i am doing a user
logoff with javascript but this is not browser proof so it doesn't work all
the time. or doing it with a for() statement that writes every 20 sec the
last unix time to a database, this doesn't work because the for() statements
stops executing the rest of the page so that doesn't work either

the problem:
i can only have one user online for a group, so i have to check if the first
that logges in for a group is online or not, i have a check time of 1 minut
so if a user logges off, a new user can login after a minut.

the reason:
so you think what is the problem put a logoff button on the screen and your
finished, well that would be the answer if i wasn't developing a page for
idiots that destroy the browser window by alt-f4 or the cross instead of the
logoff button.

so hope somebody hacked this problem before.

Thanks in advance

(sorry for the multi post)

G


Reply With Quote
  #2 (permalink)  
Old 10-02-2003
Tim Van Wassenhove
 
Posts: n/a
Default Re: logoff user with php *urgent*

In article <3f7bf275$0$58710$e4fe514c@news.xs4all.nl>, Spam sucks wrote:
> Hello,
>
> If somebody could help me with this one it would be very nice,
>
> the story:
> I need to check if a user is online or not at the moment i am doing a user
> logoff with javascript but this is not browser proof so it doesn't work all
> the time. or doing it with a for() statement that writes every 20 sec the
> last unix time to a database, this doesn't work because the for() statements
> stops executing the rest of the page so that doesn't work either
>
> the problem:
> i can only have one user online for a group, so i have to check if the first
> that logges in for a group is online or not, i have a check time of 1 minut
> so if a user logges off, a new user can login after a minut.



You can have function check_timeouts() and store_time() that are called
everytime a page is requested.

The store_time function only has to store the current_time.
The check_timeouts function has to compare current_time with stored_time.
If the difference for a user > 60, log the user out.

--
Visit my website at http://aardbei.madoka.be
Reply With Quote
  #3 (permalink)  
Old 10-05-2003
Nikolai Chuvakhin
 
Posts: n/a
Default Re: logoff user with php *urgent*

"Spam sucks" <nomail> wrote in message
news:<3f7bf275$0$58710$e4fe514c@news.xs4all.nl>...
>
> I need to check if a user is online or not at the moment


You can't. All you can do is to figure out who accessed your
site within the last X minutes, hours, or days.

> so hope somebody hacked this problem before.


Of course. You must assume that the user is offline, unless you
have reasons to believe otherwise (e.g., a recent access to a page
on your site with that user's credentials).

Cheers,
NC
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:23 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0