Salve ragazzi,
Allora inizio col dire che so ben poco in materia. Ho trovato questo script in giro per internet, è perfetto (per il momento), questo script serve per contare le visite uniche cotanto gli IP.
Per il momento ho impostato $expire= 86400; (24ore) ma vorrei che a ogni mezzanotte ricominciasse a ricontare gli IP.
Se invece voi avete uno script ancora meglio, ho il sito hostato su altervista.org, che si colegasse per avere le vere statistiche oppure far in modo di far partire questo count da un certo numero.
Scusatemi per il disturbo, grazie mille in anticipo!!
Codice PHP:
<?
///////// FlatFileCounter v1.0 //////////
// copyright & written in Aug 2003 //
// by Lukas Stalder //
// contact: [email]flounter@planetluc.com[/email] //
// Visit [url]www.planetluc.com[/url]! //
// enjoy it! //
//////////////////////////////////////////////
/*
Installation
1. change the $expire variable's value to whatever you want
2. upload the 2 files (flount.php, flount.log)
3. chmod the flount.log file to 777
4. include the flount.php wherever you want to cont your visits
by inserting <? include('flount.php');?> into your site
that's it!
================== FOR SUPPORT ========================
For support requests please use the BOARDS on
[url]www.planetluc.com/forum/[/url] (post in the appropriate
forums please!)
In very urgent cases (and I mean that) you can try
to catch me over one of the messengers below:
icq: 133613557
msn: [email]shakkalakka@hotmail.com[/email] (for messaging
purposes only!)
Or if you don't have any messengers use this
email address: [email]support@planetluc.com[/email]
========================================================
*/
$expire= 86400; // ip expires after $expire seconds
$logfile= "flount.log"; // file where visits and ip logs are stored
// *************************** don't change anything below this line *************************
$incpath=substr(__FILE__, 0, strrpos(__FILE__, "/")+1);
$logfile=$incpath.$logfile;
$ip= getenv('REMOTE_ADDR');
$visits=0;
$badhit= false;
$now= time();
$ips = array(array());
if (file_exists($logfile)){
if ($loggedips=file($logfile)){
$visits=trim($loggedips[0]);
for ($i=1; $i< count($loggedips); $i++){
$loggedips[$i]=trim($loggedips[$i]);
$ips[$i] = explode('||', $loggedips[$i]);
if (($ips[$i][0]==$ip) && ($now-$ips[$i][1]< $expire))
$badhit= true;
}
if ($badhit)
echo $visits;
else{
$visits++;
$fp= fopen($logfile, 'w');
fputs($fp,"$visits\n");
for ($i=1; $i< count($loggedips); $i++){
if ($now-$ips[$i][1] < $expire)
fputs($fp, $ips[$i][0]."||".$ips[$i][1]."\n");
}
fputs($fp, "$ip||$now\n");
fclose($fp);
echo $visits;
}
}
}else
echo "logfile is missing";
?>

PS: avete anche uno scrip per utenti on line?