I know the code must be a one-liner, but what is it to find out how many users are viewing a page currently... It's gotta be a listener of some sort. Help!
One way:
in the user table, when a user requests a page update a 'timerequested' field with a timestamp of NOW() and update a 'page viewed' field with the page requested (pageid or whatever).
when you display that page, query your user table for users having viewed that page within the last n minutes.
Obviously, when that user goes on to another page their info changes so they're not going to be listed as viewing the original page. Does that make sense?
Thanks for that. But it seems a little extensive for a simple need. For instance ASP has the Application variable which you can Count the current users.
I would imagine PHP has a standard command for this. Am I wrong?
I would imagine PHP has a standard command for this.
No.
Am I wrong?
Yes.
Well that sucks.
Yup.