one fairly simple method is to make a copy of your form, and include it in your validation page if there is an error. Then all you need to do it to insert the variable as a value for each form element.
e.g
in validation script
if (empty($name))
{
include 'form2.php'
}
then in form2 you would put
<input type="text" name="name" value="<? echo $name?>">
this would insert the name value in the text box name.
hope this is of help