Hi Guys, I have a php site that allows users to upload images using a form file field... The next page previews the image, but if they go 'Back' to edit the form, the image path is not cached and they have to re-Browse for the image(s). (Firefox does cache this, but IE does not.) I'm trying to find a way to populate each file field with their last selection on their return to the original page and I'm wondering if I can pass that variable forward to the second page and then back to the first or if there are any other tricks that I'm not aware of. Anyway, any suggestions would be much appreciated. Thanks- Mike
If the next page shows a preview then the file has already been uploaded - why do they need to keep the path to that image when they go back to the original page?
Thanks for the replies... When they return to edit (Back/Javascript -1), they make their changes and then resubmit the new edited form... In IE this form does not include the originally entered paths to the images local to their computer nor the URLs to the previously uploaded images... So now when they see the edited preview, the images are not included... Since the image paths were left blank when they resubmitted... I was hoping to find a quick fix, but it looks like I'll have to have the image values written to the DB an then called back up. I'm not a PHP guy, but I'll have to figure something out. Thanks again!
You don't need to go as far as a database from what I can tell, you can use sessions. Instead of using the history for going back, use a back button as part of the form that reloads the previous page. Then you can go back and forward between the pages and store any information across them in _SESSION values. I don't know what kinda size images you're uploading but I can't imagine dialup users being too impressed having to re-upload if they do decide to make changes.
Thanks... I checked out the sessions option a few days ago, but ran into a problem... My upload form has each image named like: name="upload[]" (all the same) There are a total of 5 spots for images on the form and the upload class takes care of naming them in the order they come in and leaving blanks, etc... is there a way to use session for 5 files that all of the same form 'name'? and you are correct... dial up users probably don't like my site much! haha thanks again-