This is the easiest to install users online script I have found. It is included here with written permission from perlonline.com. Your host needs to support cgi scripts and provide you with a place to run them for you to be able to install this script.
Follow these easy steps for installation:
Add this code to your page where you want the counter to appear:
Upload the updated page to your server, and if you see a number you've installed it correctly.
You can also add the code to your site using SSI, but your pages have to have the .shtml extension if your server requires it:
<!--#include virtual="/cgi-bin/online/online.cgi" --> users online