of course someone using aol would ask this... if you are using sessions, this code will display the number of unexpired sessions. that is the best estimate you can get. http is stateless so you never know when a visitor left or is just idleing.
$path_to_sessions = "/usr/local/apache/logs/sessions/";
$dir = dir($path_to_sessions);
$unique_users = array();
while($file = $dir->read()) {
if (($file != ".") && ($file != "..") && (!is_dir($file))) {
if(filesize("/usr/local/apache/logs/sessions/".$file)) {
$filename = "/usr/local/apache/logs/sessions/".$file;
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
session_decode ($contents);
if(!in_array($saved_id, $unique_users)) $unique_users[] = $saved_id;
}
}
}
$dir->close();
echo sizeof($unique_users)." users online";
echo "AOL IS FOR @!#$ HEADS";