Nikolas
Fri 26 August 2005, 03:09 pm GMT +0300
Here is the code for a very simple counter that you can add to your site :
You can add it to the .php page that you want to count, plus you can add this code if you want it to be visible :
Code:
<?php
if(file_exists("hits.txt"))
{
$hits = file_get_contents("hits.txt");
}else{
$hits=0;
}
$hits++;
$ha = fopen("hits.txt", "w");
fwrite($ha, $hits);
fclose($ha);
?>
if(file_exists("hits.txt"))
{
$hits = file_get_contents("hits.txt");
}else{
$hits=0;
}
$hits++;
$ha = fopen("hits.txt", "w");
fwrite($ha, $hits);
fclose($ha);
?>
You can add it to the .php page that you want to count, plus you can add this code if you want it to be visible :
Code:
<?php
echo $hits." visitors";
?>
echo $hits." visitors";
?>