hello
I am trying to make a script that can upload multiple files (currently I set it to five).
I made the form look like this:
$i = 1;
while ($i <= 5)
{
$form .= "here goes the content of the form";
$i = $i + 1;
}
I have three inputs in this form (title, description, file to be uploaded).
when the form submits the page that analyze the form looks like this:
$i = 1;
while ($i <= 5)
{
$imgtitle[$i] = $_post['$imgtitle[$i]'];
$imgdes[$i] = $_post['imgdesc[$i]'];
$file[$i] = $_files["cfile[$i]"]["tmp_name"];
$realname[$i] = $_files["cfile[$i]"]["name"];
$type[$i] = $_files["cfile[$i]"]["type"];
$size[$i] = $_files["cfile[$i]"]["size"];
$ext[$i] = strrchr($realname[$i],'.');
$i = $i + 1;
}
the problem is that all the values has empty values. I tried to work around this problem and did the following (take the image title as example):
$imgtitle = $_post['$imgtitle'];
$newtitle = $imgtitle[$i];
I came up with the title of the first image only.
any advice??