Or even better if you want server side validation in case user has javascript turned off.
use this
if some error
use this code.
print '<form action="adduser.php3" method="post">';
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
print '<input type="hidden" name="'. htmlspecialchars($key) .'" value="'. htmlspecialchars($val) .'">' ."\n";
}
print '<input type="submit" value="Go Back">';
And on your adduser.php3 set each fields value to the variable name. ie
<input type="text" name="firstname" value="<?php print $firstname; ?>">
I know this one works I have used it before