3
I have a problem that I think is easy to solve, but I don’t know how to solve.
Below is a script to record who accessed the page. It worked great, but it overrides one access on top of the other, and I need every IP you accessed recorded, one underneath the other.
Besides I don’t know how to set the schedule, it’s showing up with 5 hours more.
<?php
/* se o arquivo não existir, será criado, dê
permissão 777 na pasta onde ele será criado */
$arquivo = "includes/spy.txt"; // arquivo que gravará os dados
$data = date("d/m/Y H:i:s"); // Data do acesso
$ip = $_SERVER['REMOTE_ADDR']; // IP de acesso
$host = getHostByAddr($ip); // Host de acesso
$pagina = $_SERVER['PHP_SELF']; // Página de acesso
$browser = $_SERVER['HTTP_USER_AGENT']; // Browser de acesso
$fp = fopen($arquivo, "w+");
fwrite( $fp,
"Data: $data | IP: $ip | host: $host | Pagina Acessada: $pagina | Navegador: $browser"
);
fclose($fp);
?>
My friend, thank you very much! It worked perfectly!
– Diego
Hi Diego. Cool, if this answer solved your problem, you can mark it as "accept" by clicking on the icon below the answer score. More details on http://meta.pt.stackoverflow.com/questions/1078/como-e-por-que-aceitar-uma-reply
– bfavaretto