I'm trying to create a form with a file upload which isn't the hard part, but after the first page is submitted I want to put in confirmation before then executing a mysql insert and the file upload in what would be a third step.
The problem I have is after the user selects the file for upload in step 1 and I've got this is step 2, how do I then carry this over to step 3?
With the rest of my details I'm using hidden form fields, but how do I get the file for upload from step 1 to step 3?
A/ Upload the pic in a temp directory B/ Display the thumbnail of the pic next to the form where user can enter title, date and description C/ Upload the pic into your final directory and thumbnail directory, delete the one in your temp directory. D/ If successfully done, update the database.
Although I don't usually drop source code to stranger :) but I just made an exemplified version for someone else, so if you also want to see it, PM me.
The three step are all written in the same file (therefore same URL) and use an upload_pic class... Works like a charm !
Thanks for this but I'm not sure it's exactly what I'm looking for.
I'm really just interested in a "bridging" method to pass the file information forward one step through the form before running the upload script in a third step; maybe something equivalent to a hidden file to just a way passing the image information so it can be uploaded later.
You can store relevant data in sessions if you want to and access the session vars you need on each page and then process all at the end. The benefits of sessions are good if you have an instance where you need people to go back to previous pages.