I believe you're trying to validate the data and tries to tell the client to CLICK BACK to edit/modify the input. Well, for me the best way is to make a simple file with the complete form... like
form.html
<form>
Name: <input type = text name="name" value="<? $name ?>">
<input type = submit name="submitbtn" value="Submit">
</form>
-- end of form.html
script.php
<?
if (!isset($submitbtn) {
include("./form.html");
/ since in this case, an echo $name will produe a null value..so u will see a blank text field. /
} // end oF IF
else {
if (validate($name)) {
// means that the input is ok..
.. do some processing.....
}
else {
// problem with the input.
echo "there is a problem with your input...";
include("./form.html");
}
} // end of else
?>
-=======================================
in this solution, you don't have to go back to edit or modify the inputs.. it will display the error message plus the form with its previous content... 🙂 ....
🙂
hope this helps..
Jun