Of course it can be done.
Basically, you echo out any entered variables in their respective value attributes in the form elements, e.g.
<input type="text" name="varname" value="<?php
if (!empty($_POST['varname'])) {
echo htmlspecialchars(stripslashes($_POST['varname']));
}
?>