Is there a simple way to prevent form text fields going blank while validation is being processed in php?
try this
<input type="text" name="fname" value="<?php echo (isset($_POST['fname']) && $_POST['fname']) ? $_POST['fname'] : ''; ?>" >
You need to add some logic. You can use session for this if the submit page is differ.
<input type="text" name="nameField" value="<?php echo $_POST['nameField']; ?>" >
You have to hold the name field in the value, so the $_POST variable will be remembered when you submit the form.
You have to add form validation to your form and so you can hold a $errors array where you can put the errors in. When you add the error for each error in your form fields to that array you can put them in a list. You read this one out with a for each loop.
You can use a function to check the validation of the form and do things like:
$errors = array();
$postedVals = $_POST;
if(empty($postedVals['email'])){
$errors[] = 'Please fill in a correct form.';
}