ciao
io ho questo script...
Codice:
<?
$timemax = "300"; //Max. tempo utenti on line sul sito
$ipadress = $REMOTE_ADDR;
$timenow = explode (" ", microtime());
$timenow = $timenow[1];
include ("online.dat");
$timedelete = $timemax;
$deleted = $deleted + $timedelete;
if ($deleted < $timenow){
$file = fopen("online.dat","w+");
fputs($file, "<?PHP \$deleted = \"$timenow\"; ?>\n");
$number = count($visitor_b);
for ($tel = 0; $tel < $number; $tel++){
$visitor_a = $visitor_b[$tel];
$visitor_a[0] = $visitor_a[0] + $timemax;
if ($visitor_a[0] > $timenow)
fputs($file, "<?PHP \$visitor_b[] = array('$visitor_a[0]','$visitor_a[1]'); ?>\n");
}
fclose($file);
}
$visitor_b = "";
include ("online.dat");
$number = count($visitor_b);
for ($tel = 0; $tel < $number; $tel++){
$visitor_a = $visitor_b[$tel];
if ($visitor_a[1] == $ipadress)
$save = "nee";
}
if (!$save){
$file = fopen("online.dat","a");
fputs($file, "<?PHP \$visitor_b[] = array('$timenow','$ipadress'); ?>\n");
fclose($file);
}
$visitor_b = "";
include ("online.dat");
$number = count($visitor_b);
for ($tel = 0; $tel < $number; $tel++){
$visitor_a = $visitor_b[$tel];
$visitor_a[0] = $visitor_a[0] + $timemax;
if ($visitor_a[0] > $timenow)
$online = $online + 1;
}
if (!$online)
$online = 1;
if ($online == 1)
print ("users online: $online · record: ...");
else
print ("users online: $online · record: ...");
?>
devo aggiungere il record utenti online sapete dirmi come? non ci riesco...