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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.