Re: Emtying Variables
| From: | Torsten Roehr | Date: | Sat, 17 Jul 2004 14:01:26 +0000 |
| Subject: | Re: Emtying Variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190847@lists.php.net to get a copy of this message | ||
"Harlequin" <michael.mason@arraspeople.co.uk> wrote in message
news:20040717133440.14589.qmail@pb1.pair.com...
> What's the best way of emptying my variables once my form has done with
them
> because although I disconnect from the database if the user refreshes the
> screen it sends another e-mail to me.
Even when you reset all variables on the page (e.g. with $_POST = array())
the user can always refresh and therefore re-submit your form.
To avoid this you could do a redirect after processing the form:
// process form here
header('location: ' . $_SERVER['PHP_SELF']); exit;
Of course then you will have to pass any notices for the user via get (or
store it in a session variable).
Hope this helps.
Regards, Torsten Roehr