I've written a script so the user can upload an image ($filename) to the server. The image is input using a form, then checked for type (ie .jpg)/file size/and is diaplayed on the current page. In another form on the same page, the user can input their firstname and lastname. This is then posted to newpage.php and displayed. My problem is I cannot post the image onto the second page too and display it. I know I should probaby use one form, but I cannot figure out how to upload the image/perform the checks first/then post to newpage .php along with the firstname and lastname. Here is a sample of my code, with comments on what I am trying to achieve : Hope somebody can help me, thanks.
<form action="" method="POST" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="50000">
<p>Upload Image: <input type="file" name="imgfile"><br>
<font size="1">Click browse to upload a local file</font><br>
<br>
<input type="submit" value="Upload Image">
/*== the script now checks the file type .jpg and uploads it and displays it on THIS page ==*/
<p>
</form>
<form action="newpage.php" method="post">
First Name :
<input type="text" name="firstname" />
<br />
Last Name :
<input type="text" name="lastname" />
<br />
<p>
<input name="submit" type="submit" value="Click to View Paper"/>
/== the firstname and lastname are now posted to newpage.php and displayed ==/
/== the problem is, the image file ($filename) is not sent with it so I cannot display the image on newpage.php ==/
</p>
</form>