tr5
asked on
Working with sessions and input type=file in a multi-page form
Hi
I need to make a multi-page form. One of the pages will have "input type=file" elements.
1. Is it possible to save these values in session variables for posting? Will the actual file upload somehow be done when I finally submit the whole form?
2. Regarding posting generally: How do I post session variables at the end of the process of the user filling in all the pages? Do I make a dummy form with hidden variables for all the variables previously saved as session variables?
Thank you
tr5
I need to make a multi-page form. One of the pages will have "input type=file" elements.
1. Is it possible to save these values in session variables for posting? Will the actual file upload somehow be done when I finally submit the whole form?
2. Regarding posting generally: How do I post session variables at the end of the process of the user filling in all the pages? Do I make a dummy form with hidden variables for all the variables previously saved as session variables?
Thank you
tr5
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the explanation.
Oh whoops, I hope you noticed my silly error. When I listed out the four different properties of $_FILES, the list should have looked like this:
$_FILES['uploadFile']['tmp _name']
$_FILES['uploadFile']['nam e']
$_FILES['uploadFile']['siz e']
$_FILES['uploadFile']['err or']
(Since we named it "uploadFile" in the HTML portion.) But I think that should have become clear with the rest of my comment.
And as for you, dr_dedo, what on Earth do you mean when you ask, "why would u need to post session variables anyway??????" (You didn't need to use six question-marks; one will suffice.) There are myriad reasons anyone would want to do this! It is true that you usually do things with the $_POST variables like add them to databases, mail them, etc., but storing them across sessions is also a perfectly logical thing to do in a number of cases.
$_FILES['uploadFile']['tmp
$_FILES['uploadFile']['nam
$_FILES['uploadFile']['siz
$_FILES['uploadFile']['err
(Since we named it "uploadFile" in the HTML portion.) But I think that should have become clear with the rest of my comment.
And as for you, dr_dedo, what on Earth do you mean when you ask, "why would u need to post session variables anyway??????" (You didn't need to use six question-marks; one will suffice.) There are myriad reasons anyone would want to do this! It is true that you usually do things with the $_POST variables like add them to databases, mail them, etc., but storing them across sessions is also a perfectly logical thing to do in a number of cases.
instead of having this query "select name from table1 where lname=$_POST['lname'], u can use select name from table1 where lname=$_SESSION['lname'] !!
got me ?? i mean u already got the data, and if u must have in $_POST[] form, then make $_POST['lname'] = $_SESSION['lname'] (POST is an array after all)
for question 1..... it is so tricky !!!