Page 1 of 1

enqueue users

Posted: Mon Jun 19, 2006 10:01 am
by yamobe
Hello, well... I have been trying to achieve this task with not very good results. Hopefully someone can help me.
I want to do the following thing:

I have a webpage with authentification, and it is a virtual lab to control a motor remotely, so only ONE person is allowed to enter to my website, otherwise a lot of people could use the motor at the same time... whick is not possible.

Well, what I want to do, is:

person A enter the site... now he has a time of T seconds before beeing disconnected
person B wants to enter:
_if A is using the site, B is first in the queue to enter the site
_if A is disconnected, B enters
person C wants to enter
_if A is using the site and B is in the queue, C enters to the queue as number 2


I don“t need you to give me the code to do this (unless you really want to), but I would like to know some references to read so I can do this.. because I really don't know how.

Thanks

Posted: Mon Jun 19, 2006 10:07 am
by feyd
sounds like a "given each user a token" while you "record the order of tokens" kind of deal. You could use a page refresh or something similar (Ajax maybe) that does a pulse check on the user queue updating their position information as well as helping automate the token decay without the need of a cron.

Posted: Mon Jun 19, 2006 10:17 am
by yamobe
yeah... token is a good work to start my search, then you are right.. I could refresh the page every few seconds to update the positions. cool

Posted: Mon Jun 19, 2006 5:51 pm
by yamobe
now a new problem pops up

when I refresh the page I loose the nick and password variables I get with $HTTP_POST_VARS

should I work this out with some session variables=?

Posted: Mon Jun 19, 2006 6:22 pm
by Ambush Commander
Yep.