I am actually working on that exact thing....
this is basically what I have done...
<?
$form_data = "
<FORM ACTION='this_page.php' METHOD='post'>
NAME: <INPUT TYPE='text' NAME='name'>
<INPUT TYPE='hidden' NAME='check' VALUE='1'>
<INPUT TYPE='submit'>
";
if ($check) {
if (!$name) {
echo "Please enter a name.";
echo $form_data;
}
else {
echo "your name is $name!";
}
}
else echo $form_data;
Of course you will have more fields than this, but it's the same basic thing. What I am now encountering is the use of multiple error codes and error messages stored inside a db.... trying to get specific form fields to turn yellow if they are not filled out... of course this is like maybe 40 lines of code in a total of over 1100 so far.... so it's really a little problem 🙂
Hope that helps