oh, right, the page refreshes when validation fails, so the post empty, sorry about that.
you could save the form to session variables, and use the sessions instead. a quick way to do that is to add the following code at line 1:
<?php
@session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
foreach($_POST as $key => $value) {
$_SESSION['savedform'][$key] = $value;
}
}
?>
this will create a session away named saved form with an index for each form element that you can use in the value for the form instead of the post:
value="<?php echo((isset($_SESSION['savedform']['FormInputName']))?$_SESSION['savedform']['FormInputName']:"") ?>"