Hey,
I've been working on an uploader, where you can fill in how many files you want to upload.
For this, is use the for($i=1;$i<=$amount;$i++) thing.
Works great, but the problem lies in the submit.
If I press submit, I want to loop a certain part of my script (the upload ofcourse), but I just can't get it to work.
I've got a form, and the input type=file gets looped for $amount times (whatever you fill in).
I'm naming the file fields file$i, where $i is the number of the loop it's currently in.
So if I want to upload 2 files, they will be named file1 and file2.
Works as well, but the POST_FILES is freaking om me.
When I use
for($i=1;$i<=$amount;$i++)
{
$filename=$HTTP_POST_FILES[file$i][name];
}
I get an error............. (unexpected T-VARIABLE, expecting ])
I've also tried to name the file fields like this: file[1], file[2], but that doesn't work either.
Thanks,
Menno