Hey,
I have a script that passes data to a script (POST) that changes then value in a mysql field and then uses header() to return to the page when the user started the change. Now in some browsers when we are returned to the page it does not change the value unless you hit the refreash button. (so essentially it is just like hitting the back button) Is there any way for the page to refreash using header() or another way????
Thanks A Million,
Newbie[/i]
Refreash After Header()
Moderator: General Moderators
send these headers on the page so cacheing will be disabled:
Code: Select all
<?php
header('Pragma: no-cache');
header('Cache-Control: no-cache, must-revalidate');
?>-
Subliminal
- Forum Commoner
- Posts: 40
- Joined: Thu Oct 23, 2003 8:12 pm
Which Page?
Sorry which page do this go on? the main page or the script?
Thanks for your speedy reply
Thanks for your speedy reply
You could safely place this on both (if I understood your initial question correctly):
see php.net/header and http://www.w3.org/Protocols/rfc2616/rfc2616 for more information.
Code: Select all
<?php
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// Make sure that you send your headers *before* you display anything to
// the page( ie, before you echo())
//.... Your Code below ......
?>-
Subliminal
- Forum Commoner
- Posts: 40
- Joined: Thu Oct 23, 2003 8:12 pm
Thanks,
You Rock... great thanks guys... I was putting the headers after the echo() so it didn't work. Thanks very much...
I tried your code evilMind but it didn't work - the code provided by hedge did though.. i put them in both the same spots is their a large difference?
Thanks again... this is a great network BTW... I hope to be able to contribute soon enough.
I tried your code evilMind but it didn't work - the code provided by hedge did though.. i put them in both the same spots is their a large difference?
Thanks again... this is a great network BTW... I hope to be able to contribute soon enough.