It is really quite easy.
What you want is a form that you can fill in and submit.
Then when the user forgets to fill out a field, you want to tell the person that that field needs to be filled.
But, you also want to offer the form to the user again, with all the previously filled out fields already filled, so the user only has to add the missing data to it.
You'd use one script that can
a) print the empty form
b) receive submitted data and store it
c) receive submitted data and print the form again with data .
In pseudo code:
- Start the script
- Check if the user has submitted data to this script
- If no data was submitted, set the $check_fields to 0; and print the form.
- If data was submitted:
-- Check if any field data is missing.
-- If there is data missing, set the $check_fields to 1 and print the form.
-- If all fields are filled, process the data and exit.
The Pre-filled out form would look like this:
<?
echo "<input name=bla value=$submited_value>";
if (($check_fields) && ($submitted_value==""))
{
echo "You must fill out this field";
}
... etc for all fields.
?>