Solved

clear POST information

Posted on 2013-02-04
2
223 Views
Last Modified: 2013-02-24
I have a small python/django web site and I'm using a html form POST some information, annoyingly however this information is stored in POST so when a user refreshes in say IE/chrome they get that warning message about the page containing POST data. How do I clear the POST data after it has been processed so a user can refresh and not see this warning message?

 Also I have some logic as follows that detects a POST
    if request.method == "POST":
         blah blah

Open in new window

This is fine when I actually post the form, but when I refresh the page it also detects the POST and does the logic that I now dont want to do.
How can I solve this also??

Thanks
0
Comment
Question by:Wanting2LearnMan
2 Comments
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 250 total points
ID: 38851309
How would you clear via the server something that exists on the client? This is a feature of each browser, and it is meant to cue users in that they are submitting a form twice. Think about how upset a user will become if their $100 purchase was submitted twice! (...even if in reality he was the one that clicked the button twice!)
0
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 250 total points
ID: 38851718
Set your form to POST to a handling script, and once you've finished processing the form data, redirect to the finalised page. That way, the finalised page won't have the POST array (because the form was never posted to it).
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
Read about why website design really matters in today's demanding market.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question