The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
cheers
$File = "/freeola/users/6/5/sr0123456/htdocs/Hits.dat";
if ( file_exists($File)) {
$fp = fopen($File, "r");
flock($fp, 2); # Lock the file to prevent errors occuring.
$Hits = fgets($fp, 1024);
$Hits = trim($Hits);
$Hits = $Hits + 1;
flock($fp, 3); # Release the File Lock.
fclose($fp);
print "
This page has been visited $Hits times
";$fp = fopen($File, "w");
fwrite($fp, $Hits);
fclose($fp);
} else {
print "
ERROR: The Hits file does not exist
";}
?>
You will need to place that into the page you wish to display the hits, and ensure that page has a .php extention, not a .htm one.
You will also need to create a text file called Hits. Do this in Windows notepad.
When you upload it, you will need to place both within the htdocs folder, and CHMOD the Hits file so it is readable and writable. If your not sure what that means, read up on your FTP programs manual/help file.
cheers