header question
Moderator: General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
header question
what is the header that i put in so when i hit back to a submitted post page it does not ask somtin like "the page you are going to has POST data, would you like to resubmit that data?" kinda deal.
- trukfixer
- Forum Contributor
- Posts: 174
- Joined: Fri May 21, 2004 3:14 pm
- Location: Miami, Florida, USA
You cant, as far as I know - it's stored in your browser history .
The trick to that is, use the post-process-redirect method .. (It's got a name, cant think of it right now) basically you start on page a, post to page b, page b takes your post data and processes it (or assign to session, whatever) and with no further ado, redirects you to page c .. there's a way to do it so that clicking "back" button wont resubmit post data..
I havent really studied this issue in depth, however I *did* touch on an idea that occurred to me that I wrote out in my blog... Within the next couple weeks, I'll be wrestling with the issue myself, so any better solutions to the "back and resubmit" problem other than what I have already figured out would be nice..
The trick to that is, use the post-process-redirect method .. (It's got a name, cant think of it right now) basically you start on page a, post to page b, page b takes your post data and processes it (or assign to session, whatever) and with no further ado, redirects you to page c .. there's a way to do it so that clicking "back" button wont resubmit post data..
I havent really studied this issue in depth, however I *did* touch on an idea that occurred to me that I wrote out in my blog... Within the next couple weeks, I'll be wrestling with the issue myself, so any better solutions to the "back and resubmit" problem other than what I have already figured out would be nice..
-
kevinoneill
- Forum Newbie
- Posts: 6
- Joined: Tue Nov 15, 2005 7:19 pm
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
If you use header() to redirect after processing of the page (basically like trukfixer said) then you clear the POST data and you won't get the message (and users won't know).
Mac
Mac
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
no no i want the post data to still be there, i just dont want it to ask the user. its for a search thing, it searches and finds the results (yay!) then you can view the profile of the person then if you hit back, to go back to your search results it says "in soviet russia, post data posts you" or some other equally commy message. i dont want that message, i just want it to go back and resubmit the post data. i know this is possible its just a specific header.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
hummmm maybe it is not possible. i know i used
in the past and it worked but now it seams to not be working. this is very sad indeed
Code: Select all
header('Cache-Control: private, pre-check=0, post-check=0, max-age=0');- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
How about a 303 redirect? It's in the PHP Manual somewhere ...
Anyway by using a 303 redirect the POST page isn't cached and therefore no prompting of the user about POST data.
http://ppewww.ph.gla.ac.uk/~flavell/www ... irect.html
Code: Select all
header('Status: 303 See Other');
header('HTTP/1.0 303 See Other');
header('Location: http://' . $_SERVER['SERVER_NAME']
. $_SERVER['PHP_SELF'];
exit();http://ppewww.ph.gla.ac.uk/~flavell/www ... irect.html
Switch the browser you use?shiznatix wrote:hummmm maybe it is not possible. i know i used
in the past and it worked but now it seams to not be working. this is very sad indeedCode: Select all
header('Cache-Control: private, pre-check=0, post-check=0, max-age=0');