Hi all,
This is doing my head in so if any guru's out there can quickly identify where I am being stupid - I would greatly appreciate it!
I have four upload fields:
<input name=\"uploadaimage[]\" type=\"file\" class=\"smallimageupload\" />
<input name=\"uploadaimage[]\" type=\"file\" class=\"smallimageupload\" />
<input name=\"uploadaimage[]\" type=\"file\" class=\"smallimageupload\" />
<input name=\"uploadaimage[]\" type=\"file\" class=\"smallimageupload\" />
When I post the page i run this code to upload the files:
foreach ($_FILES['uploadaimage']['name'] as $name) {
$targetpath = "uploads/";
if (move_uploaded_file($_FILES['uploadaimage']['tmp_name'], $targetpath . basename($_FILES['uploadaimage']['name']))) {
print "upload completed: $targetpath<br />";
} else {
print "upload failed<br />";
}
}
After updateing thia, nothing is upload. All 4 fail to upload.
How can i fix this?
Thanks in advance.