|
Posted by no on 12/11/06 09:09
On Mon, 11 Dec 2006 06:16:47 +0100, Vincent Delporte
<justask@acme.com> wrote:
>On Sun, 10 Dec 2006 16:42:18 GMT, no@emails.thx wrote:
>>Submit the form and in your action recall the page and now you're into
>>the first block of code that handles your $_POST[] data. If you
>>refresh this then you will get the message warning you that you are
>>going to resend the POST data again.
>
>That's what I don't understand: The second time around, I'm only
>reading data that were POSTed from the form the first time, so why
>does FFox warn me? I can use a transaction number to check if it's
>already been submitted, and it's just the user hitting F5.
Well, the POST method is just special - it is used primarily where a
script will be taking entered form data and doing something creative
with it - like sending an email or updating a database, so in that
case the user should be warned that they risk running the script
twice, with all the inherant problems that would cause.
Sure, you could trap the script being run twice - but not always. In
some cases it is difficult, verging on impossible to know how many
passes through the script there have been - hence this protection.
AFAIK, there is no way to process POST data without the message coming
up on a refresh because it is a function of the browsers (include
Opera and IE in the list) and not of the script. So, in that case you
just have to write your script to work around it :o)
Best wishes,
Chris R.
[Back to original message]
|