Its pretty simple... when the user logs on to your site, pass the cookie and add him to your MYSQL db or add a blank text file with his name ie:
if( $logon == "true" )
{
chdir('currentusers');
touch('$username');
}
elseif( $logoff == "true" )
{
chdir('currentusers');
unlink('$username');
}
Its not overly difficult to do it using files and then on your backend script, you just do this:
print "Users Currently Logged on:<br>";
$handle=opendir('currentusers');
while (false!==($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file<br>";
}
}
closedir($handle);
What might be better is to use IP addys instead of usernames so you could use the $REMOTE_ADDR variable. If you need any more help, let me know...
Hope this helps,
Brad Taylor
Senior Web Producer
BradCom Industries LTD
brad_at_getcoded.net (replace the at with @)