You must write the value of the $_POST. Example:
<input type="text" name="txtMyInput" value="<?php echo $_POST['txtMyInput']; ?>" />
If $_POST is empty, nothing will apear in the input, but if you had an error in your form you will recover the data.
Hope this helps!
Mauricio