Jump to content

can you run two $_FILES functions on the same page


shadiadiph

Recommended Posts

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???

 

 

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?

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.