Sorry for the bother, but I would really like to understand this as its taken me 2 days to try to fix now. Here is a snippet of my code.
I have a file (count.php) which does the counting.
When I put in the header functions into it.. it solves the refresh problem! IE. when I view count.php in a browser and hit refresh.. the #s update.
However, the problem comes when I try to include this .php file within another php file (test.php) it will give me the errors mentioned in my previous post and the counter doesn't refresh. If I remove the headers, the errors go away but the counter still doesn't refresh.
I hope this is clear. I have included the relevant code for both below.
Please, any advice is appreciated,
Steve.
<?
// this is count.php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
// Full sys path to count.txt
$counter_file = "C:\Xitami\webpages\count.txt";
//..... REST OF CODE FOR COUNT.PHP
?>
//.... THIS IS TEST.PHP WHICH CALLS COUNT.PHP
Total of <? include("C:\Xitami\webpages\count.php"); ?> hits to this page.
//.. SOME MORE HTML CODE