View Full Version : "100" People Online
Disaronno
30-10-2005, 08:50 PM
Hi, On The Habbox Homepage It Says There Arre (Example) 176 Zombies Online - On My Website I Would Like One, Not The Same Just Saying There Are (example) 50 People Online, How Is It Done? Bearing In Mind This Is On Freewebs But I Might Go On Something Else
.=.=3x=.=.
30-10-2005, 08:55 PM
There Are Many Sites Which Provide This Thing.
www.dynamicdrive.com
For Example.
Just Search Around On Google.
I'm Sure Youll Find What Your Looking For ;)
Disaronno
30-10-2005, 09:01 PM
I Dont Know Where To Look. Anyone??
its best to do it in PHP!
<?
$remote = $_SERVER["REMOTE_ADDR"];
$file = "usersonline.txt";
$timeoutseconds = 60; //Tells how long the user is considered "on line"
$timestamp = time();
$timeout = ($timestamp-$timeoutseconds);
$fp = fopen("$file", "a+");
$write = $remote."||".$timestamp."\n";
fwrite($fp, $write);
fclose($fp);
$online_array = array();
$file_array = file($file);
foreach($file_array as $newdata){
list($ip, $time) = explode("||", $newdata);
if($time >= $timeout){
array_push($online_array, $ip);
}
}
$online_array = array_unique($online_array);
$online = count($online_array);
if($online == "1"){
echo "Users Online: $online";
}else{
echo "Users Online: $online";
}
?>
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.