Posted by Pedro Graca on 11/14/06 17:17
["Followup-To:" header set to comp.lang.php.]
Shelly wrote:
> If I click the browser refresh button, I get another submittal. How do I
> "unset" the status so that it doesn't think I clicked the submit button when
> I click the refresh button?
You don't.
What you can do is keep a variable for that specific form.
When you receive the submission, verify the variable to check whether
it's the first post.
<?php
session_start();
if (isset($_POST['theSubmitButton'])) {
if ($_SESSION['submitted']) {
// OOPS!
} else {
$_SESSION['submitted'] = true;
// rest of script;
}
}
// ...
echo '<input type="submit" name="theSubmitButton">';
$_SESSION['submitted'] = false;
// ...
?>
--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.
Navigation:
[Reply to this message]
|