You are here: Re: unsetting « PHP Programming Language « IT news, forums, messages
Re: unsetting

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация