refresh after back button

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jhop
Forum Newbie
Posts: 2
Joined: Mon Feb 28, 2005 5:26 pm

refresh after back button

Post 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?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Provide a link to the file it would go back to :roll:
jhop
Forum Newbie
Posts: 2
Joined: Mon Feb 28, 2005 5:26 pm

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

aside from setting the page as a noncachable page.. not that I know of.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
Post Reply