Preventing multiple form submissions - php Form

Author Topic: Preventing multiple form submissions  (Read 635 times)

Offline alex

  • Global Moderator
  • *****
  • Posts: 77
  • Karma: +19/-0
    • View Profile
Preventing multiple form submissions
« on: December 17, 2010, 01:33:14 AM »


Code: [Select]
<?php @session_start();
if(isset(
$_POST['submit']))
{
if (!isset(
$_SESSION["reload"]))
$_SESSION["reload"] = 0;
$_SESSION["reload"] = $_SESSION["reload"] + 1;
if (
$_SESSION["reload"] > 1)
{
echo
"Error";
die;
}
}else{
?>

<form name="maForm" action="index.php" method="post">
<input type="submit" value="Submit" name="submit">
</form>
<?php ?>