Thread: Best php counter/stats tool?
View Single Post
  #11  
Old 10-03-2006
arenlor arenlor is offline
Senior Member
 
Join Date: Aug 2006
Location: Jaa, kore da.
Posts: 108
Send a message via ICQ to arenlor Send a message via AIM to arenlor Send a message via MSN to arenlor Send a message via Yahoo to arenlor
Default

I'm not sure what you're looking for but here is a good counter. [note: I hate counters and I just use this for fun, the important thing is putting it into MySQL for you to look at and run these things on]
all it requires is a database with the table ips with the keys of an int named whatever you want and auto_increment primary key, and a text or varchar length 15 named ip
$ip = $_SERVER['REMOTE_ADDR'];
$trace = "insert into ips values(NULL,'$ip')";
$save = mysql_query($trace);
$show = "select * from ips where ip = '$ip'";
$post = mysql_query($show);
$num = mysql_num_rows($post);
echo "

You have visited this page $num times

";
$totalget = "select distinct ip from ips";
$gettotal = mysql_query($totalget);
$totalnum = mysql_num_rows($gettotal);
echo "

$totalnum people have visited this page

";
$visits = "select * from ips";
$tell = mysql_query($visits);
$visnums = mysql_num_rows($tell);
echo "

And this page has been visited $visnums total times

";


If you need any explanations or help at all just contact me, I wrote that out of boredom the other day.
__________________
FAQ
Reply With Quote