You could use a simple PHP script, here is a very simple one that would work.
PHP Code:
<?php
$myFile = "count.txt";
$fh = fopen($myFile, 'r');
$The_Count = fread($fh, filesize($myFile));
fclose($fh);
If ($The_Count!="5"){
$The_Count=$The_Count+1;
$myFile = "count.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $The_Count);
fclose($fh);
}else{
$The_Count=0;
$myFile = "count.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $The_Count);
fclose($fh);
header("Location: lpagehere.html");
}
?>
Sorry dont know how to highlight the PHP code on this forum.