[Maypole] Problem with Cookbook Method
petersm
petersm@venzia.com
Wed, 12 May 2004 07:37:27 -0500
Perrin Harkins <perrin@elem.com>
> On Wed, 2004-05-12 at 11:18, Jim Abraham wrote:
> > The problem with updating the database and then internally switching to
> > another display page, rather than sending a redirect to a display page
> > is that, if the user then, for whatever, idiotic reason, clicks Reload
> > on that page, he will at the very least get an annoying "POST data"
> > message from the browser, or, at worst, repost the edit page and do a
> > redundant database write.
>
> And if you redirect the user, you will break the back button. If a
> redundant write is a serious problem, it's easy to insert a unique ID in
> the form to make sure it doesn't get sent to the database twice. I
> think this will come down to a question of what is best for your
> particular application.
I agree with Perrin here. The 'POST data' message is usually enough to not
have the user resubmit the data (at least in my limited experience). I think
the existing solution is simple and will work in most cases. If you feel like
it's not adequate maybe you could write another example showing how to do it
by a redirect (since that's really the only way to avoid this right?).
Michael Peters
Venzia