On Sunday, June 23, 2002, at 09:53  AM, Pag wrote:

>       Is it possible to code in PHP a small indicator on a site saying 
> how many people are viewing that page at the moment?
>       Sorry if its a silly question, but i am a newbie at PHP. If it is, 
> could you point me in the good direction? i mean, some function or 
> something.

Sorry, can't be done.  People aren't really "online" when they are using 
a web browser.  They request a page, and it gets sent to them, and the 
web server forgets about them.  Unless the web server logged their 
request, but then the web server has no way of knowing when the user 
"stops" looking at the page, so... you get the picture.

You'd have to write a Java applet or something that can maintain state.  
HTTP can't do this.  Unless you're really creative and you use 
JavaScript and sessions (and even then it won't be very reliable).



Erik Price
Web Developer Temp
Media Lab, H.H. Brown

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to