Ver Mensaje Individual
  #16 (permalink)  
Antiguo 10/07/2008, 08:22
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años, 9 meses
Puntos: 2135
Respuesta: contador por click no cuenta...!!!!

Solo si la IP no esta en la base de datos?, prueba esto:
Tabla ip_hits:
- id autonumeric
- ip int signed

Tabla counter
- id autonumeric
- hits int unsigned

Código PHP:
$ip $_SERVER['REMOTE_ADDR'];
$ip ip2long$ip );
$query "SELECT '1' FROM `ip_hits` WHERE `ip`='$ip' LIMIT 1";
$result mysql_query$query ) or die( "Query: $query, error: " mysql_error() );
if( 
mysql_num_rows$result ) == ) { // no existe en la bdd, insertamos y sumamos
        // insertamos
        
$query "INSERT INTO `ip_hits` (`ip`) VALUES ('$ip')";
        
mysql_query$query ) or die( "Query: $query, error: " mysql_error() );
        
// sumamos
        
$query "UPDATE `counter` SET `hits`=`hits`+1 WHERE `id`=0";
        
mysql_query$query ) or die( "Query: $query, error: " mysql_error() );

Saludos.