Hello All
Could you please let me know of any good php script that tell us the number os the users online on that Website . ?
NUmber of Users online
Moderator: General Moderators
Re: NUmber of Users online
To accurately gauge this, you would need ajax. However, all you'd really need to do to get a good estimate is log an IP with a timestamp in a database. After ~5 minutes have gone by, if that timestamp hasn't updated, delete the entry.
Re: NUmber of Users online
That's almost identical to what I do. It's pretty cool: http://jackpf.co.uk. Check it out if you so desire.
I don't use ajax though, it just seems like pointless server load...I just define a user as online if they've requested a page in the last ten minutes.
I don't use ajax though, it just seems like pointless server load...I just define a user as online if they've requested a page in the last ten minutes.
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Re: NUmber of Users online
You don't need AJAX for this
First thoughts: You'll need to ubiquitously collect data on users that are online or not, involving sessions and some form of persistence and access to the persistence. The only way you could make this into a reusable "script" or library, as you're looking for Supercops, is if the site is using a MVC style system i.e. all requests are coming in at one point.
You cannot do this without access to the server. If you want to find out how many people are on a site you do not own you have little chance and even if you could do it you'd probably be breaking a law in the process, so don't!
First thoughts: You'll need to ubiquitously collect data on users that are online or not, involving sessions and some form of persistence and access to the persistence. The only way you could make this into a reusable "script" or library, as you're looking for Supercops, is if the site is using a MVC style system i.e. all requests are coming in at one point.
You cannot do this without access to the server. If you want to find out how many people are on a site you do not own you have little chance and even if you could do it you'd probably be breaking a law in the process, so don't!