Hi,
I'm creating a form where the user can upload up to 20 files at a time. Right now I'm doing it with 20 File-form fields (if anyone knows how to do it better please tell me) named vcard1 to vcard20 (I also tried name them vcard[1] to vcard[20]).
I'm having a problem extracting the info about each file through a loop.
I need to extract $vcard1_name (or $vcard[1]_name) up to $vcard20_name.
I had a similar problem a while ago with checkboxes and got some good help there. I solved it by either naming each checkbox as a array or (which I ended up doing) getting the value via $HTTP_POST_VARS["name$a"] in a loop.
However - I can't seem to be able to do the same in this case. I tried the following code:
for ($a=1;$a<=20;$a++) {
$varName="vcard$a";
$varName.="_name";
$varName="$$varName";
$name=$HTTP_POST_VARS[$varName];
$display_block.="
Fil $a: $name<br>
";
}
But it didn't work. I'm starting to think you can't take out the $vcard1_name variable via HTTP_POST_VARS, so how do I get the value out of this? Using an array (vcard[1] etc. didn't seem to help in this case either) ...
/Björn