PHP Example
Screen shot
index.php

<?php
$filename="counter\data.txt";

if(file_exists($filename))
{
$handle = fopen($filename, "r");
$counter = (int)fread($handle, 20);
fclose($handle);

$counter++;

echo "Your Vistor Number ".$counter;

$fp=fopen($filename,"w");
fwrite($fp,$counter);
fclose($fp);
}
?>

You can download source code here