<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
<title>PHP Example</title>
</head>
<body>
<?php
    $serverside_count=0;
    $name="php_counter.txt";
    if (file_exists($name)) {
        $file=fopen($name, "r");
        list ($serverside_count) = fscanf($file, "%d");
        fclose($file);
    }
    $serverside_count++;
    $file=fopen($name, "w");
    fwrite($file, "$serverside_count\n");
    fclose($file);
    echo "$serverside_count\n";
?>
</body>
</html>