Jump to content

Using no broswer cache


Shadowing

Recommended Posts

Ive been using no cache at the very top of my page

and then using a header with a number in the link

 <?php header("Location: settings.php?change=3"); ?> 

so the form updates after submit

 

Then I have a if statment to echo that form was submited

Any better ideas on how I can do this? 

Shouldnt I beable to just use no cache and use a standard echo in the form with no header in the form

the problem with the way im doing it now if user keeps refreshing the screen it keeps saying the echo. which makes sense

maybe its cause im not using the action in my form correctly with putting a link there?

small example below

 <?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache");
header("Pragma: no-cache");

if(isset($_GET['change'])) {

               echo "form submited";}

if(isset($_POST['build_naq'])) {
		if(!empty($_POST['stargate_naq'])) {
                       mysql_query("UPDATE settings SET naq=  '".mysql_real_escape_string($_POST['naq'])."'");
	}
	header("Location: settings.php?change=3");
}
?> 

Link to comment
https://forums.phpfreaks.com/topic/254595-using-no-broswer-cache/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.