Shadowing Posted January 8, 2012 Share Posted January 8, 2012 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"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/254595-using-no-broswer-cache/ Share on other sites More sharing options...
Shadowing Posted January 8, 2012 Author Share Posted January 8, 2012 Only other way i can think of on how to echo something on the page and show the updated information from the form is to use sessions Quote Link to comment https://forums.phpfreaks.com/topic/254595-using-no-broswer-cache/#findComment-1305519 Share on other sites More sharing options...
Shadowing Posted January 9, 2012 Author Share Posted January 9, 2012 ive decided im going to just go back through several pages and use sessions instead for this situation. Cause it would allow me to carry information to the next page too. Quote Link to comment https://forums.phpfreaks.com/topic/254595-using-no-broswer-cache/#findComment-1305708 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.