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(
Gary E. Terry wrote:
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];
Gary E. Terry wrote:
I don't know if we are on the same page here... Maybe we are and I am just
an idiot.
The fields in my db are image1 image2 and image3.
There are only three fields in the form that is being passed to the
php script. But, on the form they are named pictures[].
Here is the
-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 30, 2006 10:10 PM
To: Gary E. Terry
Cc: PHP DB
Subject: Re: [PHP-DB] Arrays from forms
Gary E. Terry wrote:
I don't know if we are on the same page here... Maybe we are and I am just
an idiot.
The fields in my db are image1
Gary E. Terry wrote:
Sorry about that, not CC'ing the list...
the values are not always empty, they should always have something in
them...
There should be 3 images uploading. But, I am sure just to make life
interesting,
there will be times when there could be as little as one uploaded.
-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 30, 2006 10:39 PM
To: Gary E. Terry
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Arrays from forms
Gary E. Terry wrote:
Sorry about that, not CC'ing the list...
the values are not always empty, they should always have
Gary E. Terry wrote:
If I print them, there's nothing. all three
Here is the same file, in test mode...
?php
include db.inc.back.php;
foreach ($_FILES[pictures][error] as $key = $error) {
if ($error == UPLOAD_ERR_OK) {
echo $error_codes[$error];
move_uploaded_file(
Nope... here is the output.
-- -- Array ( [error] = )
-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 30, 2006 10:56 PM
To: Gary E. Terry
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Arrays from forms
Gary E. Terry wrote:
If I print them
Gary E. Terry wrote:
Nope... here is the output.
-- -- Array ( [error] = )
So files aren't being uploaded properly at all.
Does your form have:
enctype=multipart/form-data
in the form header?
ie
form name='blah' action='form2.php' enctype=multipart/form-data
Are your picture
OK.. I am a moron.. Forgot that I had changed the name of the field in the
form, and got sidetracked and didn't change it in the
php... But, still not working correctly.
Here is the output: Array -- Array -- Array
from:
?php
include db.inc.back.php;
foreach ($_FILES[pictures][error] as
Gary E. Terry wrote:
OK.. I am a moron.. Forgot that I had changed the name of the field in the
form, and got sidetracked and didn't change it in the
php... But, still not working correctly.
Here is the output: Array -- Array -- Array
Oops this:
${image.($key+1)} =
-DB] Arrays from forms
Gary E. Terry wrote:
OK.. I am a moron.. Forgot that I had changed the name of the field in the
form, and got sidetracked and didn't change it in the
php... But, still not working correctly.
Here is the output: Array -- Array -- Array
Oops this:
${image.($key+1
Gary E. Terry wrote:
I know you really meant :
${image.($key+1)} = $_FILES['pictures']['name'][$key];
Oh yeh ;)
Glad we got there in the end! :)
--
Postgresql php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit:
13 matches
Mail list logo