Forum Moderators: coopster
if you just want a hit counter type action then you would just increment a number which would represent 'views' the trouble with this is that it would increment every time you refresh the page.
if you wanted a more unique view then when someone hits the page you could store information about that user, user agent, ip, whatever you like.
you could also do it to file if you were only tracking a single page
create a file called tracker.txt with just a 1 in it, no returns, nothing else, put this in the same dir as this file
<?php
$mytrack = 'tracker.txt';
$oc = file_get_contents($mytrack);
$nc = $oc + 1;
$fp = fopen($mytrack,'w');
fwrite($fp,$nc);
fclose($fp);
echo 'old: ',$oc,'<br>new: ',$nc;
?>
it still has test code in there, you can get rid of that echo line once you see how it works
that's it