Hi All,
I have a major bug, and its really getting on my nerves. Basically i have a cache problem, where the first page is not refreshing correctly. Example of my code:
Page 1:
<?
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
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");
if ($counter > 1)
{
$counter == 0;
header("Location:session_header.php?".SID);
}
session_start();
session_register("counting");
$counting++;
echo "$counting<br>\n";
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<a href="session_header2.php">Next</a>
</body>
</html>
PAGE 2:
<?
header("Expires: ".gmdate("D, d M Y H:i:s")." GMT"); // Always expired
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");// always modified
header("Cache-Control: no-cache, must-revalidate");// HTTP/1.1
header("Pragma: nocache");// HTTP/1.0
session_start();
//session_register("counting");
$counting++;
echo "$counting<br>\n";
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</html>
I am using two test scripts and they are basically incrementing a counter. However when i press the "Back Button" whilst on page two, i expected the counter to increment on page 1, however the counter remained set to 1. The page has not refreshed.
Please can anyone help
Thanks
Colin
Page 1 and 2 are