shadiadiph Posted May 19, 2009 Share Posted May 19, 2009 I have two forms on the one php page they only display one at a time one is to upload and the other is to edit so I have two instances of $fileatt_name = $_FILES['fileatt']['name']; on the same page i tried using the same $fileatt_name = $_FILES['fileatt']['name']; for the second function but kept getting and error undefined index fileatt I then changed the second instance to $fileatt_name = $_FILES['newatt']['name']; and it worked once but when i try to resubmit it goes back to an error saying undefined newatt do i have to unlink from a $_FILES somehow there is nothing wrong with the surrounding code they both work fine if they are seperate i have the feeling once i have executed it i have to unset it somehow??? Link to comment https://forums.phpfreaks.com/topic/158709-can-you-run-two-_files-functions-on-the-same-page/ Share on other sites More sharing options...
Masna Posted May 19, 2009 Share Posted May 19, 2009 Try combining these two separate forms into one collective form. Link to comment https://forums.phpfreaks.com/topic/158709-can-you-run-two-_files-functions-on-the-same-page/#findComment-837021 Share on other sites More sharing options...
shadiadiph Posted May 19, 2009 Author Share Posted May 19, 2009 my page is over 3000 lines long at the moment i have the max file size twice on the page the forms are not next to each other in the script and do not display at the same time when you say combine the forms do you mean still have two <form id="uploadimages"></form><form id="editimages"></form> or use the same form id for both forms? Link to comment https://forums.phpfreaks.com/topic/158709-can-you-run-two-_files-functions-on-the-same-page/#findComment-837035 Share on other sites More sharing options...
Masna Posted May 19, 2009 Share Posted May 19, 2009 my page is over 3000 lines long at the moment i have the max file size twice on the page the forms are not next to each other in the script and do not display at the same time when you say combine the forms do you mean still have two <form id="uploadimages"></form><form id="editimages"></form> or use the same form id for both forms? When I say combine the forms, I mean condense the two separate forms into one form. When one form is submitted, are you expecting data passed through the other form to also be available in $_FILES? Link to comment https://forums.phpfreaks.com/topic/158709-can-you-run-two-_files-functions-on-the-same-page/#findComment-837036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.