I know this is ultra basic but I am sure there is a better way than how I do it.
I always submit the form to the same page:
<?php
$error = "";
if(isset($_POST['submit'])) {
//check form
if($formOK==1) {
//add record and redirect
} else {
//allow page to continue so display form again
$error = "Not completed";
}
}
echo $error;
?>
<form>
<input type="text" name="name" value="<?php echo $_POST['name']; ?>">
</form>
…so the above always shows the values entered in the form
The problem is I get the web-page expired problem.
If I header redirect after form submit (either another .php page or the same one) I then lose ability to display values submitted in $_POST.
What do I do to get $_POST values but no web-page expired messages?