SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
-
Mar 14, 2003, 11:46 #1
- Join Date
- Jan 2003
- Posts
- 5,748
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Avoiding : Page Refresh using Back Button
Hello folks. I read somewhere how I can avoid getting the 'reload page since content has expired' screen after someone presses 'back' after sending a FORM.
Though for the life of me I can't remember where I read it, nor the exact way of doing it, bar the fact that you had to redirect to another page or something.
Does anyone know of a solution to this problem I wonder ?
-
Mar 15, 2003, 22:47 #2
- Join Date
- Jul 2001
- Location
- Missouri
- Posts
- 3,428
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
well, if you don't want the user to be able to go back to the POSTed page, you could redirect to a different page after doing your processing in the POSTed file.
now, if you wanted them to be able to go back to the page, but have it automatically refresh without the "expired" message, that's a browser issue and i don't think you can really change it from PHP.- Matt** Ignore old signature for now... **
Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
"Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR
-
Mar 16, 2003, 00:29 #3
-
Mar 16, 2003, 01:51 #4
- Join Date
- Jan 2003
- Posts
- 5,748
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks folks for the help - trispective; first link doesn't exist btw but thanks anyways.
From what I can remember, once the $_POST data has been sent, and dealt with, you re-direct to another page outside the FORM.
So if you press BACK or REFRESH the data is not sent since the FORM (after originally being redirected) doesn't exist.
I cannot remember the exact mechanics behind it, though it worked on various browsers on Win98SE and Win2000Pro. 8)
Once I've the time, I'll have another bash at it and get back to this post later.
-
Mar 16, 2003, 15:07 #5
- Join Date
- Sep 2002
- Location
- n/a
- Posts
- 477
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Dr Livingston
http://www.webhistory.org/www.lists/...95q2/0440.html
Originally Posted by Dr Livingston
or
the meta tag:
<META HTTP-EQUIV="refresh" CONTENT="0; URL=http://yoururl.com">
I hope that is what you are were looking for.
-
Mar 17, 2003, 10:12 #6
- Join Date
- Jan 2003
- Posts
- 5,748
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks, to redirect after headers have been sent I usually use Javascript for this - no markup - but from what I've been reading is this;
Once you've sent a FORM you need to redirect to a new page, thus if the user refreshes the page, it'll refresh the redirected page and not the one with the FORM on it.
But in my case, I have validation to take care of as well, and all this is through XML/XSL. LoL
Yes, what fun. Not. If I redirect and there is bad input from user, I need to redirect back to the page with the FORM, and most likely loose any correct data the user did input. LoL.
-
Mar 19, 2003, 00:12 #7
- Join Date
- Oct 2002
- Location
- Utah (USA)
- Posts
- 309
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Validate the data before you redirect, that way you can send a browser 'BACK' command with JS rather than the redirect. This should keep the form fields all filled in for their second attempt to fill it out right. Guess you couldn't include a message that told them what was wrong very easily that way though.
$slider = 'n00b';
Bookmarks