Hi,
I haven't tried this, but the last Login date field lastLoginDate in user accounts seems to be updated each time a logged in user accesses the site.
If that's true, and you set a limit of say 5 minutes of inactivity as indicating logged off, then you could count the number of user records who have a last log in date of less than 5 minutes ago as the number of logged in users. I don't know how you would make that a dynamic number but you could reload every 30 seconds or so.
Try a google search for "number of logged in users PHP" for some more specific ideas.
Hope that makes sense.
Good luck and please post your findings
Jerry Kornbluth
The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php