$log = 'contador.log';
$IP = getenv('REMOTE_ADDR');
$add = true;
$hits = 0;
$dia = date("d");
$mes = date("n");
$ano = date("Y");
$data="$dia-$mes-$ano";
$IP="$IP/$data";
if (!file_exists ($log)) {
echo "Error: $log does not exist.";
exit;
}
$h = fopen ($log, 'r');
while (!feof ($h)) {
$line = fgets ($h, 4096);
$line = trim ($line);
if ($line != '')
$hits++;
if ($line == $IP)
$add = false;
}
fclose($h);
if ($add == true) {
$h = fopen ($log, 'a');
fwrite($h, "
$IP");
fclose($h);
$hits++;
}
//echo $hits;
?>
Departamento de Matemática - PUC-Rio
Permanent Faculty
Name: Sergey Galkin
Title: Doutor, Instituto de Matemática Steklov, 2008.
Office: 874L
Position:
Phone: 3527-1737
E-mail: s
Research Areas: Topology
Mathematics Department / PUC-Rio
Rua Marquês de São Vicente, 225 - Edifício Cardeal Leme, sala 862 - Gávea - Rio de Janeiro - CEP 22451-900
Telefones: (+55-21) 3527-1280, (+55-21) 3527-1281, Fax: (+55-21)3527-1282