$file = file("how.dat"); $dat = "how.dat"; $count = count($file); $time = time(); $plus = "\x31"; $s_t = "\x36\x30"; if (getenv('HTTP_X_FORWARDED_FOR')) { $ip = getenv('HTTP_X_FORWARDED_FOR'); } else { $ip = getenv('REMOTE_ADDR'); } $open = fopen("$dat","a"); fputs($open, "$ip::$time::\r\n"); fclose($open); for ($scan = 0; $scan <= $count - $plus; $scan++) { list ($u_ip,$u_t) = explode("::","$file[$scan]"); if ($u_t + $s_t > $time and $u_ip != $ip) { $plus++; } } $online = $plus; echo "На сайте: $online";