I assume this is going to have to be based on registered users. If so, this is pretty much going to have to be a custom script every time. However, I found a quick tutorial for you that may help you get started: http://www.phpit.net/article/creatin...ne-script-php/
__________________
I build web things. I work for the startup Please login or register to view this content. Registration is FREE .
This does not have to be based only on registered users if you only need a number.
You must already understand that there is no such term as "user is online" in respect of HTTP protocol, there is only the term "user made the request not more than N seconds ago". On first request from a user you set a cookie for a period of time which you consider to be the period of being "online", e.g. 5 minutes. On next requests you refresh that cookie to last for more 5 minutes and save that request information to some storage like DB or file. To display stats you need to obtain the number of unique user identificators which were used not more than 5 minutes ago.
This does not have to be based only on registered users if you only need a number.
You must already understand that there is no such term as "user is online" in respect of HTTP protocol, there is only the term "user made the request not more than N seconds ago". On first request from a user you set a cookie for a period of time which you consider to be the period of being "online", e.g. 5 minutes. On next requests you refresh that cookie to last for more 5 minutes and save that request information to some storage like DB or file. To display stats you need to obtain the number of unique user identificators which were used not more than 5 minutes ago.
well, mtishetsky answer very accuratelly.
to display exact stat we must also store the IP address of the users. that will help us to identify unique users.
what do you think ?
__________________
No # 1 FREE Domain Name Low Cast High Quality Web Site Development and Web Hosting
Click Here
I assume this is going to have to be based on registered users. If so, this is pretty much going to have to be a custom script every time. However, I found a quick tutorial for you that may help you get started: http://www.phpit.net/article/creatin...ne-script-php/
You can only create a script that count the visitors that went on your site on the last minutes. You can't see all of them if they are actually online. Only with woopra you can