heres two handy little functions for your core code file :
function dontexpire(){
Header("Expires: Mon, 26 Jul 2010 05:00:00 GMT");
Header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
Header("Cache-Control: public");
};
function expire(){
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-cache, must-revalidate");
Header("Pragma: no-cache");
};
then, at the top of your php program, or at least before you send any html, do this
include("myfavouritecorefile.php");
include("variousotherstuff.php");
expire();
print "foo bar";
or
include("myfavouritecorefile.php");
include("variousotherstuff.php");
dontexpire();
print "foo bar";
if you would like to cache the page.
actually, dontexpire() is quite handy for people who like forms. it means that you can cache a page which has been generated using a form, so if someone clicks away, then uses the back button to return to the page, shock horror, no page expiry.
QUESTION
do you want to prevent a page being cached, or prevent someone clicking the back button? the answer to your problem will be different if the latter.