Ver Mensaje Individual
  #18 (permalink)  
Antiguo 16/01/2008, 13:56
Avatar de hgp147
hgp147
 
Fecha de Ingreso: diciembre-2006
Ubicación: Buenos Aires, Argentina
Mensajes: 980
Antigüedad: 19 años, 10 meses
Puntos: 36
Re: Contador de IP que no se repita

Ya esta, le agregue un contador al código de toforo.

Código PHP:
<?php

$ip 
= $_SERVER['REMOTE_ADDR'];

$fp = file_get_contents("ip.txt","r");
 
$exp = explode(';', $fp, -1);

$total = count($exp);

if (
preg_match("/$ip/i", "$fp")) {

$visitante = $total;

}else{

$fh = fopen("ip.txt", 'a');

fwrite($fh, "$ip;");
 
fclose($fh);

$visitante = $total+1;

}

echo 
"Visitante nº: $visitante";

?>