User restriction script

I have no idea how to do this…I am trying to code at this moment a script that allows a certain number of people to access the site and then closes it off until the number gets below the allowed amount then starts letting people on again…Does anyone know how to do this?

Thanks
Zeth

How will you know if a user left?

Thasts preety much what I have to figure out

Then I don’t think it’s possible since the connection between client and server will only be open while the pages are being built. After that, the page is cached on the client pc and the PHP script has been executed. I don’t think PHP is your tool for what you want to achieve (in fact, if you want to do this webbased at all, a Java applet sounds like the only possible way to do this to me).

Is it possible for a php script to access the site every few seconds?

Only if you run it as a separate process, and not as a webserver preprocessor. But even then it would eat your resources as opposed to a separate process (in C++ for example) that keeps a connection alive. I presume you’re familiar with sockets?

Sponsor our Newsletter | Privacy Policy | Terms of Service