PHP textfile counter
This script should be included on all the pages of your site, and the instructions to return the number of users online are included in the script (it uses a function). The script can be used with logins and can then return anonymous and registered users online, and can also check if a user is online (instructions in the script). This was orignally made for my site, but I hope it applies to yours!