Solved

clear POST information

Posted on 2013-02-04
2
225 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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
"Go Fund Me" type plugin 5 42
Getting the NAO robot to play soccer 1 41
Checking https returns 301 21 56
Passing client data from form to server 5 19
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
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…

756 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