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

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -