\n"); fclose($fp); } //write to file $fp = fopen($file_name, "a"); $write = $ip."||".$c_time."\n"; fwrite($fp, $write); fclose($fp); //open file to as array, to count online $file_array = file($file_name); $online_array = array(); for($x = 1; $x < count($file_array); $x++){ list($ip, $ip_time) = explode("||", $file_array[$x]); if($ip_time >= $time){ array_push($online_array, $ip); } }//end for $online = array_unique($online_array); $online = count($online); if($online == "1"){ print "User online: $online"."
"; }else{ print "Users online: $online"."
"; } ?>
Make your own free website on Tripod.com