TIMEX project Statistics
$ora = date ("H:i");
$today = date ("d/m/Y");
$monthtoday = date ("m/Y");
echo "Updated $today $ora
";
//-------------- insert the correct path ----------------------------------
$dati = file ("./external_LOG_TIMEX.dat");
$risp = is_file ("./external_LOG_TIMEX.dat");
$size = filesize ("./external_LOG_TIMEX.dat");
$ncontatti = count ($dati);
echo "Total counts: $ncontatti
";
// reading statistics ARRAY
$i=0;
while ($i < $ncontatti)
{
$infos = explode ("<>" , $dati[$i]);
$anno = substr ("$infos[0]", 6, 4);
$mese = substr ("$infos[0]", 3, 2);
$meseanno[$i] = substr ("$infos[0]", 3, 7);
$ip[$i] = $infos[1];
$host[$i] = $infos[4];
$iphost[$i] = $ip[$i] . "" . $host[$i] . "" ;
//$iphost[$i] = $ip[$i] . $host[$i] ;
$pagina[$i] = $infos[2];
$i++;
}
?>
// Monthly contacts
echo "
";
echo "Monthly contacts
";
$meseannoX = explode(",", implode(",", $meseanno));
$meseannoXX = array_count_values($meseannoX);
$maxvalore = max ($meseannoXX);
list ($chiave, $valore) = each ($meseannoXX); $coeff = (250/$maxvalore) ; reset ($meseannoXX);
while (list ($chiave, $valore) = each ($meseannoXX))
{$valore2 = round (($valore*$coeff),0);
echo "
" ;};
// Visited pages
echo "
";
echo "Visited pages
";
$paginaX = explode(",", implode(",", $pagina));
$paginaXX = array_count_values($paginaX);
arsort ($paginaXX); reset ($paginaXX);
list ($chiave, $valore) = each ($paginaXX); $coeff = (250/$valore) ; reset ($paginaXX);
while (list ($chiave, $valore) = each ($paginaXX))
{$valore2 = round (($valore*$coeff),0);
echo "
" ;};
// IP numbers and HOST
echo "
";
echo "IP numbers and DNS hosts
";
$ipX = explode(",", implode(",", $iphost));
$ipXX = array_count_values($ipX);
arsort ($ipXX); reset ($ipXX);
list ($chiave, $valore) = each ($ipXX); $coeff = (250/$valore) ; reset ($ipXX);
while (list ($chiave, $valore) = each ($ipXX)) {
//if ( $valore < 20){break;};
$valore2 = round (($valore*$coeff),0);
echo "
" ;};
?>
echo "
Statistics total dimension: ";
print($size/1000);
echo " Kbytes
";
?>
echo "
StatFast 1.0 by
Emiliano Principi.
";
?>