Arrays from forms....
| From: | Gary E. Terry | Date: | Thu, 30 Nov 2006 17:36:34 +0000 |
| Subject: | Arrays from forms.... | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-42778@lists.php.net to get a copy of this message | ||
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.
Attachment: [application/x-pkcs7-signature] smime.p7s
Attachment: [application/x-pkcs7-signature] smime.p7s