PDA

View Full Version : clear form after submit



Andy128
03-17-2006, 07:08 PM
I have a form set up to send name,address,phone number to my e-mail address upon hitting send or submit. If I re-open this page anew, the form info is cleared out. If I hit back button- the information is still there.

Is there a script to clear the form upon submission. The script I am using currently is below.

<script language="php">
$email = $HTTP_POST_VARS[email];
$mailto = "email@address";
$mailsubj = "Form submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
</script>

Any suggestions welcomed.
Andy