Hi
I'm trying to send some headers to stop the page from being cached, but I get this usual error: "Headers are already sent"!
Hey, I'm not sending my headers in the middle of the page, there is NO space before these commands, and I'm putting them exactly above my document, only after the php starting tag! Here it's my code:
<?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
?>
Don't bother yourself, it's nothing wrong with the code! I copied that exactly from the php manuals, the only thing that might be the cause of my problem (I think!) is that I'm trying to use it in the "index.php" file, the file that is loaded automatically by the server when the address is entered. I say it because I wrote the same thing for other pages and I didn't have any problem.
If I'm missing anything in here, I really appriciate it if you point it out!
bijan
PS: There is no extra space in my file!