I have a single webpage and i would like to track how many times it\'s visited without using a database.
I thought about XML, updating a file every time a user visit
*/
// Open the file for reading
$fp = fopen("counterlog.txt", "r");
// Get the existing count
$count = fread($fp, 1024);
// Close the file
fclose($fp);
// Add 1 to the existing count
$count = $count + 1;
// Display the number of hits
// If you don't want to display it, comment out this line
echo "Page views:" . $count . "
";
// Reopen the file and erase the contents
$fp = fopen("counterlog.txt", "w");
fwrite($fp, $count);
// Close the file
fclose($fp);
?>