I have used the following code several times before, and have recently found it to try and use again. There now seems to be an error which I cannot fix, can anyone see what I am doing wrong?
foreach ($_FILES['image']['name'] as $i => $name) {
$uploadfile = $uploaddir . basename($name);
if (!move_uploaded_file($file_post["tmp_name"][$i],$uploadfile))
{
echo set_e('error','Image ['.$i.'] not uploaded','');
}
}
The error I get is
Warning: Invalid argument supplied for foreach() in /sitefolder/functions.php on line 1096
line 1096 is the first line in the first code box