On Sun, 18 Jul 2004 11:29:25 +1000 Trejkaz Xaoza <[EMAIL PROTECTED]> wrote: > Php wrote: > > And you can also used a php variable to detect multiple submit: > > Even better would be using a token which you give to the user when the form > is displayed. That way they can't accidentally submit the form on first > entry to the site (and believe me, this can happen, because Konqueror > occasionally remembers a form submission page was in its window the last > time it was run, and tries to reload the page!)
In order to tackle reload issues, I prefer to use 3 scripts: A: one to display the form B: one to receive it through POST and process it (ie. send email) C: one to display an OK or error message Of course, depending on situation, two or more of the above can be the same script behaving differently. To avoid the reload problem, moving from step B to step C is done via: header($_SERVER['SERVER_PROTOCOL'].' 303 See Other'); header('Location: C_script_here'); The 303 response forces the browser to use GET for the redirect location. So no matter how many times the user reloads C they will only get the OK or error message, no actuall re-processing is performed. And because the redirect was done via HTTP 3xx code, not JavaScript, if the user uses BACK in the browser they go directly to A. For all purposes, B is invisible to the user. -- Skippy - Romanian Web Developers - http://ROWD.ORG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php