Page 1 of 1

refresh after back button

Posted: Mon Feb 28, 2005 5:32 pm
by jhop
I have a page that loads info from a file. You can click on a button, which takes you to another page to edit the file entries.

If I then use the back button to get back to the page that shows the file, I have to manually refresh before it will show my changes.

Is there a way around this?

Posted: Mon Feb 28, 2005 5:35 pm
by Chris Corbyn
Provide a link to the file it would go back to :roll:

Posted: Mon Feb 28, 2005 5:40 pm
by jhop
OK, that works.

Is there a way to force it to refresh, so that if they do press the back button, then it still works OK?

Posted: Mon Feb 28, 2005 5:45 pm
by feyd
aside from setting the page as a noncachable page.. not that I know of.

Posted: Mon Feb 28, 2005 5:56 pm
by Chris Corbyn
Does your page to edit the file have a form with an action="somefile.php" type thing?

If it does then just stick

Code: Select all

header('location: your_initial_file.php');
at the end of it (so long as nothing is outputted (echo'd or print'd) in that file before the header().) That way they wont even get the opportunity to click back cos they'll just end up back there anyway.

EDIT: By "it" I meant at the end of the somefile.php given in your action attribute. The file that processes the reuquest to edit the file.