Write A PHP Program To Keep Track of The Number of Visitors Visiting The Web Page and To Display This Count of Visitors, With Proper Headings
Write A PHP Program To Keep Track of The Number of Visitors Visiting The Web Page and To Display This Count of Visitors, With Proper Headings
Write a PHP program to keep track of the number of visitors visiting the web page and to display
this count of visitors, with proper headings.
<?php
echo "<h3> REFRESH PAGE </h3>";
$name="count.txt";
$file=fopen($name, "r");
$hits=fscanf($file, "%d");
fclose($file);
$hits[0]++;
$file=fopen($name, "w");
fprintf($file, "%d", $hits[0]);
fclose($file);
echo "Total number of views:".$hits[0];
?>