File size: 751B
<?php
$fajl = "gosti.txt";
$a=fopen($fajl, "a");
$asd = "1 \r\n";
fwrite($a, $asd);
fclose($a);
$file = "gosti.txt";
$linije = file($file);
$br = count($linije);
###############################
$ip = $_SERVER['REMOTE_ADDR'];
##############################
$tim=120+time();
$time=time();
$f="online.txt";
$nusk=file($f);
$sk=count($nusk);
$in=$HTTP_USER_AGENT.$REMOTE_ADDR;
$fp=fopen($f,"w+");
for($i=0;$i<$sk;$i++)
{ list($nix,$timf)=explode("|",$nusk[$i]);
if($nix!==$in && $timf>$time)
{ fwrite($fp,$nusk[$i]); } }
fwrite($fp,"$in|$tim|\n");
fclose($fp);
$on=count(file($f));
###############################
echo "Visits: $br <br/>";
echo "Online: $on <br/>";
echo "Your IP: $ip";
?>