I am dynamically creating upload file/image fields. I read the manual and it appears that php4 may have a problem with this.
http://php.unam.mx/manual/en/features.file-upload.multiple.php
However, if you look at the 13th & 15th post down, there is a way around this. Each input element must be a unique name.
Ok. So my problem is that I'm dynamically creating these fields and using them in functions. Therefore, I need to create global variables named userfile$i and don't know how to do this.
Here is my code for the first function which dynamically creates the image fields. This works fine.
for ($i = 1; $i<= $numberimages;$i++)
{
print "<tr><td>Image $i</td><td><input name='userfile$i' type='file'></td></tr>";
}
Here is my code for autogenerating global variables. This is the part I don't know how to do:
for ($i = 1; $i<= $numberimages;$i++)
{
$userfile="userfile".$i;
$userfile_name="userfile".$i."name";
$userfile_size="userfile".$i."size";
global $$userfile;
global $$userfile_name;
global $$userfile_size;
}
Many Thanks