When the form is submitted, then on page refresh the $_POST
data is still intact. So what you can do is something like this:
<input type="text" name="field_name" value="<?php echo (isset($_POST['field_name']) ? $_POST['field_name'] : ''); ?>">
What it does is that if the $_POST
data for the field field_name
is set, then echo its value.