$date =date("d-m-Y"); $ip = $_SERVER['REMOTE_ADDR']; $sql="INSERT INTO counter(date_visit,ip_visit,visit)VALUES ('$date', '$ip', '1')"; mysql_query($sql);
/*----------------------OPEN PAGE----------------------*/ $today = date('d-m-Y'); $sql="Select count(ip_visit) as visit From counter" ; $result= mysql_query($sql); $row = mysql_fetch_array($result); $visit = $row[visit]; $id_visit = $row[id_vist]; $openpage = str_pad($visit,6,0,str_pad_left);
/*----------------------TODAY BY IP----------------------*/ $today = date('d-m-Y'); $sql="Select count(DISTINCT(ip_visit)) as visit From counter where date_visit = '$today'" ; $result= mysql_query($sql); $row = mysql_fetch_array($result); $visit = $row[visit]; $id_visit = $row[id_visit]; $today = str_pad($visit,6,0,str_pad_left);
/*----------------------TOTAL IP-----------------------*/ $sql="Select count(DISTINCT(ip_visit)) as visit From counter"; $result= mysql_query($sql); $row = mysql_fetch_array($result); $visit = $row[visit]; $total = str_pad($visit,6,0,str_pad_left);
?>