websaint 0 Report post Posted September 28, 2004 Sometimes it could be useful to know how many users you got online at the moment. You can do this very easely by simple adding this script to your site: <? session_cache_expire (30); session_start(); function users() { $count = 0; $suksess = opendir(session_save_path()); if ($suksess == false) return -1; while (($file = readdir($suksess)) != false) { if (ereg("^sess", $file)) $count++; } closedir($suksess); return $count; } echo "Users online: " . users() . "<br>"; ?> Share this post Link to post Share on other sites