Allie's Simple POST sticky form
Count 1 (via hidden input)
Array ( )
Array ( )
<?php
include('../includes/header.php');
$name = isset($_POST['name']) ? $_POST['name'] : '';
$phone = isset($_POST['phone']) ? $_POST['phone'] : '';
// filter inputs
$name = htmlentities($name);
$phone = htmlentities($phone);
// show the submit
$hiddenVar = isset($_POST['hiddenVar']) ? $_POST['hiddenVar'] : 0;
$hiddenVar++;
?>
<h1>Allie's Simple POST sticky form</h1>
<form action="" method="POST">
<label for="name">Name</label>
<input type="text" size="36" id="name" name="name" value="<?php echo($name); ?>">
<br><br>
<label for="phone">Phone</label>
<input type="text" size="36" id="phone" name="phone" value="<?php echo($phone); ?>">
<br>
<br>
<input type="hidden" name="hiddenVar" value="<?php echo($hiddenVar); ?>">
<input type="submit" name="submit" value="Submit">
</form>
<?php
echo("<br>Count $hiddenVar (via hidden input) <br>");
?>
<pre>
<?php
print_r($_POST);
?>
</pre>
<?php
include('../includes/footer.php');
?>