Hi,
I got a form where users can add up to 12 files via 12 file fields.
In the page that takes care of the form I got a loop that first checks if a FIle fields is empty or not and then takes care of the file (uploading etc.) if it is not empty.
My problem is that I don't want to have to make 12 separate loops for each File field.
My first thought was to name each field File[1], File[2] etc.
Then I built a loop like this:
for ($a = 1; $a<=12; $a++) {
if ($File[$a]_name !="") {
// CODE TO TAKE CARE OF FILE
// ACCESSING FILE VIA File[$a]
}
}
However - it doesn't work. It just gives me an parse error on the (if /$File[$a]_name ...) line ..
ANyone got a suggestion how to access the File fields via a loop ?
/B