Posted by John on 09/19/05 10:20
On Sun, 18 Sep 2005 18:14:20 +0100, John <yuiouio@dfghfgh> wrote:
>I have a problem with refresh.
>
>I have a contact form that sends an email when the submit button is
>pressed. I have a hidden variable and the code for emailing is only
>executed if the variable is set. The variable is cleared at the end of
>the code. All works as expected unless the REFRESH button is pressed
>by the user in which case the script is executed and the emails are
>sent once more. Debugging shows the test variable is set again even
>though it was unset before exiting on the previous run. How can this
>be?
>
>I know there are some things I could do like using database entries or
>cookies to hold the variable or even jump to another page which I do
>not want to do.
>
>There must be a simple explanation and hopefully solution to this.
Thanks as ever for a great response and new ideas.
I did as Douglas suggested and reloaded the page with a GET which I
could test for. It also provided a thank you page which can then be
refreshed with no repercussions as Peter advised.
BTW its not about not being bothered but finding elegant solutions.
My thanks to a great group once again.
--
John
[Back to original message]
|