Ho risolto così... però vorrei che per ogni ID mi conteggiasse una visita con ugni indirizzo IP diverso.
Così com'è ora lo script sia se visualizzo la pagina.php?id=1 che la pagina.php?id=2 mi si blocca contando solo sul primo id=1
come si può fare?
Codice PHP:// Set varibles
$cookie_ip = $_COOKIE['client_ip'];
// See if the cookie is already set.
if(!$cookie_ip) {
// If not; set the cookie.
setcookie("client_ip", $_SERVER['REMOTE_ADDR'] , time()+360000);
$line[0]++; // Increase value of file by one...
$newhits = ($row_p['hits'] * 1) + 1;
$update = "update items set hits =" . $newhits . " where id = ". $row_p['id'];
mysql_query($update,$myconn) or die(mysql_error());
}
// See if the cookie IP matches the users IP
elseif($cookie_ip != $_SERVER['REMOTE_ADDR']){
$line[0]++;
}
$row_p['hits'] = $line[0]++;

Rispondi quotando