Code:
<?php
$counter = fopen("counts.txt", "r"); //this here opens the text file
$count = fread($counter, 1024); //reads the content of counts.txt
($counter); //then closes the file
$count = $count + 1; //then it increments the number
echo $count; //and displays the new number
$counter = fopen("counts.txt", "w"); //opens the text file again
fwrite($counter, $count); //and writes the new value
($dc); //close the file
?>
And there is your own hit counter! just make sure that you have a counts.txt with any number you want the count to start... also chmod counts.txt to 777 so you won't have any issues with permission... if you want a more detailed information on your website hits, use a javascript...