1

I have an HTML form which I want to post data to then display some text to the user. I've heard several people discuss this idea:

should the user go from [form page] -> [processing form post page] -> [display page] or should the user just go to a combined [form page] -> [processing form / display page]

I've heard arguments the former is more secure while the latter is less redirects.

What are some answers?

KingFish
  • 8,773
  • 12
  • 53
  • 81
  • 3
    I see this a lot, even no response when someone who was thanked by the OP nicely describes the accept button and asks to click it. The FAQ should be updated to give acceptance its own title; and more importantly there should be a limit to the open questions one can have, say 5. Questions should have to be accepted or closed. – DarkWingDuck Nov 19 '10 at 22:15
  • @SuperDuck maybe that number should be dependent on how much rep you have. Someone who has asked a large number of questions is likely to have more (truly) unanswered questions. – zzzzBov Nov 19 '10 at 22:25
  • @zzzzBov - I agree, that would be better so the number can even begin with 2 or 3 for the first questions and get much bigger shortly; in the end we just want new users to learn and get used to it. – DarkWingDuck Nov 19 '10 at 22:44
  • @ everyone: I've gone back and "Accepted" all of my answers. – KingFish Dec 31 '10 at 01:05

2 Answers2

2

To avoid caching issues, resubmission on refresh issues and similar problems: Use the POST-REDIRECT-GET pattern.

  1. Browser makes HTTP POST request with form data
  2. Server processes data and responds with a redirect response
  3. Browser makes HTTP GET request (possibly including an id that is related to the submitted data in the query string)
  4. Server responds with a 200 response and the information
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
1

From what your question asked, you could just have the [form page] -> [form page to process and display].

Paul Sonier
  • 38,903
  • 3
  • 77
  • 117