when i put together forms, like many people, i always create a "step 2" page that shows the user what they entered before it gets sent on it's way to the database. This step 2 always shows the user input at the top and recreates the form at the bottom with all of the user inputs pre-populated in the fileds, simple enough.
i am now creating a file upload form and i am finding that on the step 2 i can show the user what file they uploaded but the form with all of the pre-populated fields does not retain the chosen file.
for example:
<?
echo '
<form action="' . $PHP_SELF . '" method="post" enctype="multipart/form-data">
name: <input type="text" name="name"'; if (isset ($name)) {echo ' value="' . $name . '"';} echo '><br>
file: <input type="file" name="file"'; if (isset ($file_name)) {echo ' value="' . $file_name . '"';} echo '><br>
<input type="submit" name="submit" value="submit">
</form>
';
print_r ($POST);
print_r ($FILES);
?>
in the above script once the form is submitted the "file" field is pre-populated with the value of the submitted filename but the file is not displayed in the field. Is there a way to have the form remeber the submitted file so that becomes the default file for the step 2 page?
i hope i am being clear enough, thanks