On Mon, Apr 12, 2010 at 9:03 AM, Victor Subervi <victorsube...@gmail.com>wrote:
> On Sun, Apr 11, 2010 at 4:29 PM, Tim Chase > <python.l...@tim.thechases.com>wrote: > >> On 04/11/2010 02:53 PM, MRAB wrote: >> >>> Victor Subervi wrote: >>> >>>> Hi; >>>> I send variables to a script. The script adds appropriate lines into a >>>> database of an order to my shopping cart. When I refresh the screen, as >>>> no doubt some customers will do, it re-ads those orders. Now, I can >>>> delete them, but that's not the point. I don't want it to re-ad the >>>> orders. How do I skirt this problem? >>>> >>>> When you click on the Submit button on the form it should post the >>> data, >>> ie use method="post", not method="get". If refreshing causes it to >>> re-submit, then you're using the wrong method. This is basic stuff. >>> >> >> And if you do POST your data (which you should if you're attempting to >> change state on the server), you should use a post/redirect/get pattern[1]. >> This will prevent the browser from giving the "you've already submitted >> this data; do you want to resubmit it?" message that most should give you if >> you refresh a POST'ed page. >> >> And therein demonstrates the need to know HTTP as mentioned in my previous >> reply to you (VS, not MRAB). >> > > Man, I just forget this stuff. Dunno why. Yeah, just set a var in the URL > of the post. Right. Sorry. Thanks. > beno > > Correction. I was not familiar with Post/Redirect/Get. Thanks, Tim beno
-- http://mail.python.org/mailman/listinfo/python-list