php - Unique Visits to Website -
how make unique ip addresses increment count? code works fine except fact
<?php include('core/init.php'); banned_redirect(); include('includes/overall/header.php'); $counter='';//initilize counter $sql="select counter tb_counter"; $result=mysql_query($sql); $rows=mysql_fetch_assoc($result); $counter=$rows['counter']; // if count empty if(empty($counter)){ $counter=1; $insertcounter="insert tb_counter set counter='".$counter."'"; $result1=mysql_query($insertcounter); } echo "you visitor num=>". $counter; // increment visitor count $increasecounter=$counter+1; $sql2="update tb_counter set counter='".$increasecounter."'"; $result2=mysql_query($sql2); ?>
Comments
Post a Comment