I have a problem. I have done this before, but can't find the files. I am using the following function to upload files from a form.
foreach ($_FILES["pictures"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
echo "$error_codes[$error]";
move_uploaded_file(
$_FILES["pictures"]["tmp_name"][$key],
"images/" .$_FILES["pictures"]["name"][$key]
) or die("Problems with upload");
}
}
I also need to insert the filenames of the uploaded files into a database.
There are three fields in my db for these filenames, image1 image2 and
image3.
What would be the best way to get those filenames from the array into the
vars $image1 $image2 and $image3?
the first file in the array should be $image1 and so on.
Thanks in advance.
smime.p7s
Description: S/MIME cryptographic signature
