I use a combination of sessions, user management and a table in the database to do this, however (depending on your level of PHP experience) this might not be simple. If you don't have a user management system and just want to see how many people are using your site, it's a little easier: http://www.hscripts.com/scripts/php/usersOnline.php