By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,793 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,793 IT Pros & Developers. It's quick & easy.

I can not get file uploads to show up when I upload a file

P: n/a
I've a form that starts off like this:
<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">

<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="la******@krubner.com" /></p>

<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>

<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>

Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:

Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =la******@krubner.com
[zip_code] =22902
[time] =1187380627
)

)

)

Why is the file input not show up?

Everything was working fine a month ago, and now it is broke.

Any help is very much appreciated.

Aug 23 '07 #1
Share this Question
Share on Google+
12 Replies


P: n/a
lawrence k wrote:
I've a form that starts off like this:
<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">

<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="la******@krubner.com" /></p>

<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>

<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>

Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:

Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =la******@krubner.com
[zip_code] =22902
[time] =1187380627
)

)

)

Why is the file input not show up?

Everything was working fine a month ago, and now it is broke.

Any help is very much appreciated.
Nothing entered into the field? If it's empty, nothing will be returned.

What does print_r($_POST) show?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Aug 23 '07 #2

P: n/a
On Aug 22, 11:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
I've a form that starts off like this:
<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">
<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="lawre...@krubner.com" /></p>
<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>
<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>
Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:
Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
Why is the file input not show up?
Everything was working fine a month ago, and now it is broke.
Any help is very much appreciated.

Nothing entered into the field? If it's empty, nothing will be returned.

What does print_r($_POST) show?

Good question.

print_r($_POST) gives me this:

Array
(
[totalFormInputs] =Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =l*******@krubner.com
[zip_code] =22902
[time] =1187380627
)

)

)

[day] =05
[month] =07
[year] =2006
[choiceMade] =Array
(
[0] =createRecordsForMultipleDatabaseTables
)

)
I click the browse button (by the "file" input) and choose a JPEG
called "car_derby.jpg". But it doesn't show up in POST.

Why?


Aug 23 '07 #3

P: n/a
lawrence k wrote:
On Aug 22, 11:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>lawrence k wrote:
>>I've a form that starts off like this:
<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">
<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="lawre...@krubner.com" /></p>
<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>
<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>
Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:
Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
Why is the file input not show up?
Everything was working fine a month ago, and now it is broke.
Any help is very much appreciated.
Nothing entered into the field? If it's empty, nothing will be returned.

What does print_r($_POST) show?


Good question.

print_r($_POST) gives me this:

Array
(
[totalFormInputs] =Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =l*******@krubner.com
[zip_code] =22902
[time] =1187380627
)

)

)

[day] =05
[month] =07
[year] =2006
[choiceMade] =Array
(
[0] =createRecordsForMultipleDatabaseTables
)

)
I click the browse button (by the "file" input) and choose a JPEG
called "car_derby.jpg". But it doesn't show up in POST.

Why?



Are you sure the field is still within the form? Or did you perhaps
move the </formback too far?

Does the HTML validate?

If the HTML is correct, it should show up in the $_POST variable. But
since it isn't, you have an HTML problem - not a PHP one.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Aug 23 '07 #4

P: n/a
On Aug 23, 12:05 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
On Aug 22, 11:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
I've a form that starts off like this:
<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">
<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="lawre...@krubner.com" /></p>
<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>
<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>
Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:
Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
Why is the file input not show up?
Everything was working fine a month ago, and now it is broke.
Any help is very much appreciated.
Nothing entered into the field? If it's empty, nothing will be returned.
What does print_r($_POST) show?
Good question.
print_r($_POST) gives me this:
Array
(
[totalFormInputs] =Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
[day] =05
[month] =07
[year] =2006
[choiceMade] =Array
(
[0] =createRecordsForMultipleDatabaseTables
)
)
I click the browse button (by the "file" input) and choose a JPEG
called "car_derby.jpg". But it doesn't show up in POST.
Why?

Are you sure the field is still within the form? Or did you perhaps
move the </formback too far?

Does the HTML validate?

If the HTML is correct, it should show up in the $_POST variable. But
since it isn't, you have an HTML problem - not a PHP one.

You can see the form here:

http://www.bluewalldev.com/secondroad/profile.php?id=5&formName=my_story_edit.htm

I apologize that the site is so rough. We are at an early point of
construction. The site is ultimately suppose to be an online social
network for people recovering from addiction.

Aug 23 '07 #5

P: n/a
On Aug 23, 12:05 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
On Aug 22, 11:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
I've a form that starts off like this:
<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">
<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="lawre...@krubner.com" /></p>
<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>
<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>
Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:
Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
Why is the file input not show up?
Everything was working fine a month ago, and now it is broke.
Any help is very much appreciated.
Nothing entered into the field? If it's empty, nothing will be returned.
What does print_r($_POST) show?
Good question.
print_r($_POST) gives me this:
Array
(
[totalFormInputs] =Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
[day] =05
[month] =07
[year] =2006
[choiceMade] =Array
(
[0] =createRecordsForMultipleDatabaseTables
)
)
I click the browse button (by the "file" input) and choose a JPEG
called "car_derby.jpg". But it doesn't show up in POST.
If the HTML is correct, it should show up in the $_POST variable. But
since it isn't, you have an HTML problem - not a PHP one.
That is a good point. I usually leave validation to the graphic
designer, but we might have to do it early in this case, to figure out
this problem.

Aug 23 '07 #6

P: n/a
On Aug 23, 12:05 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
On Aug 22, 11:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
I've a form that starts off like this:
<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">
<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="lawre...@krubner.com" /></p>
<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>
<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>
Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:
Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
Why is the file input not show up?
Everything was working fine a month ago, and now it is broke.
Any help is very much appreciated.
Nothing entered into the field? If it's empty, nothing will be returned.
What does print_r($_POST) show?
Good question.
print_r($_POST) gives me this:
Array
(
[totalFormInputs] =Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
[day] =05
[month] =07
[year] =2006
[choiceMade] =Array
(
[0] =createRecordsForMultipleDatabaseTables
)
)
I click the browse button (by the "file" input) and choose a JPEG
called "car_derby.jpg". But it doesn't show up in POST.
Why?

Are you sure the field is still within the form? Or did you perhaps
move the </formback too far?

Does the HTML validate?
Hmm, no.

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.bluewalldev.com%2Fsecon droad%2Fprofile.php%3Fid%3D5%26formName%3Dmy_story _edit.htm&charset=%28detect+automatically%29&docty pe=Inline&group=0

The errors are mostly missing alt tags on the images and some li tags
used outside of ul tags. I can't see how it would effect one input in
the middle of a form, as opposed to all the inputs on a form, but I
suppose we should clean this up. It'll be next week before we get to
it, I suspect.


Aug 23 '07 #7

P: n/a
On Aug 23, 12:05 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
On Aug 22, 11:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
I've a form that starts off like this:
<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">
<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="lawre...@krubner.com" /></p>
<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>
<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>
Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:
Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
Why is the file input not show up?
Everything was working fine a month ago, and now it is broke.
Any help is very much appreciated.
Nothing entered into the field? If it's empty, nothing will be returned.
What does print_r($_POST) show?
Good question.
print_r($_POST) gives me this:
Array
(
[totalFormInputs] =Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
[day] =05
[month] =07
[year] =2006
[choiceMade] =Array
(
[0] =createRecordsForMultipleDatabaseTables
)
)
I click the browse button (by the "file" input) and choose a JPEG
called "car_derby.jpg". But it doesn't show up in POST.
Why?

Are you sure the field is still within the form? Or did you perhaps
move the </formback too far?

Does the HTML validate?

If the HTML is correct, it should show up in the $_POST variable. But
since it isn't, you have an HTML problem - not a PHP one.

What's even more odd is that I'm getting the correct results in
$_FILES. The temp name of the file is there. But it doesn't show up in
$_POST. What is that about?


Aug 23 '07 #8

P: n/a
On Aug 23, 12:05 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
On Aug 22, 11:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
I've a form that starts off like this:
<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">
<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="lawre...@krubner.com" /></p>
<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>
<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>
Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:
Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
Why is the file input not show up?
Everything was working fine a month ago, and now it is broke.
Any help is very much appreciated.
Nothing entered into the field? If it's empty, nothing will be returned.
What does print_r($_POST) show?
Good question.
print_r($_POST) gives me this:
Array
(
[totalFormInputs] =Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
[day] =05
[month] =07
[year] =2006
[choiceMade] =Array
(
[0] =createRecordsForMultipleDatabaseTables
)
)
I click the browse button (by the "file" input) and choose a JPEG
called "car_derby.jpg". But it doesn't show up in POST.
Why?

Are you sure the field is still within the form? Or did you perhaps
move the </formback too far?

Does the HTML validate?

If the HTML is correct, it should show up in the $_POST variable. But
since it isn't, you have an HTML problem - not a PHP one.
This is what I get if I do print_r($_FILES):

Array
(
[totalFormInputs] =Array
(
[name] =Array
(
[users] =Array
(
[5] =Array
(
[upload_file] =car_derby.jpg
)

)

)

[type] =Array
(
[users] =Array
(
[5] =Array
(
[upload_file] =image/jpeg
)

)

)

[tmp_name] =Array
(
[users] =Array
(
[5] =Array
(
[upload_file] =/tmp/phpiBxJrN
)

)

)

[error] =Array
(
[users] =Array
(
[5] =Array
(
[upload_file] =0
)

)

)

[size] =Array
(
[users] =Array
(
[5] =Array
(
[upload_file] =32302
)

)

)

)

)


That's what I would expect. It's bizzare, I get the right results in
$_FILES, but not in $_POST. How is that possible?



Aug 23 '07 #9

P: n/a
lawrence k wrote:
This is what I get if I do print_r($_FILES):
...

That's what I would expect. It's bizzare,
Its not bizzare. Its normal...
I get the right results in
$_FILES, but not in $_POST. How is that possible?
Cause youre provider has updated PHP. Older versions also send data of
$_FILES within $_POST. But its not a go idea to hold the data in 2 Points.

The manual says that usage of $_FILES is the prefered way since a long
time. If you would have looked in the manual before you write your
Postings, you come surely faster to the goal.

Ulf

--
_,
_(_p Ulf [Kado] Kadner
\<_) Mitglied der Freizeitvögel? ;-)
^^
Aug 23 '07 #10

P: n/a
lawrence k wrote:
On Aug 23, 12:05 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
>lawrence k wrote:
>>On Aug 22, 11:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
I've a form that starts off like this:
<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">
<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="lawre...@krubner.com" /></p>
<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>
<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>
Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:
Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
Why is the file input not show up?
Everything was working fine a month ago, and now it is broke.
Any help is very much appreciated.
Nothing entered into the field? If it's empty, nothing will be returned.
What does print_r($_POST) show?
Good question.
print_r($_POST) gives me this:
Array
(
[totalFormInputs] =Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
[day] =05
[month] =07
[year] =2006
[choiceMade] =Array
(
[0] =createRecordsForMultipleDatabaseTables
)
)
I click the browse button (by the "file" input) and choose a JPEG
called "car_derby.jpg". But it doesn't show up in POST.
Why?
Are you sure the field is still within the form? Or did you perhaps
move the </formback too far?

Does the HTML validate?

If the HTML is correct, it should show up in the $_POST variable. But
since it isn't, you have an HTML problem - not a PHP one.

This is what I get if I do print_r($_FILES):

Array
(
[totalFormInputs] =Array
(
[name] =Array
(
[users] =Array
(
[5] =Array
(
[upload_file] =car_derby.jpg
)

)

)

[type] =Array
(
[users] =Array
(
[5] =Array
(
[upload_file] =image/jpeg
)

)

)

[tmp_name] =Array
(
[users] =Array
(
[5] =Array
(
[upload_file] =/tmp/phpiBxJrN
)

)

)

[error] =Array
(
[users] =Array
(
[5] =Array
(
[upload_file] =0
)

)

)

[size] =Array
(
[users] =Array
(
[5] =Array
(
[upload_file] =32302
)

)

)

)

)


That's what I would expect. It's bizzare, I get the right results in
$_FILES, but not in $_POST. How is that possible?


That's right... I shouldn't try to answer at midnight after I've been
out with the guys... :-)

Yes, it goes in the $_FILES array, not $_POST.

Once I got some sleep and looked at this again this morning, it was
obvious :-). Sorry to steer you down the wrong path.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Aug 23 '07 #11

P: n/a
On Aug 23, 8:55 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
On Aug 23, 12:05 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
On Aug 22, 11:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
I've a form that starts off like this:
<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">
<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="lawre...@krubner.com" /></p>
<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>
<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>
Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:
Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawre...@krubner.com
[zip_code] =22902
[time] =1187380627
)
)
)
Why is the file input not show up?
Everything was working fine a month ago, and now it is broke.
Any help is very much appreciated.
If the HTML is correct, it should show up in the $_POSTvariable. But
since it isn't, you have an HTML problem - not a PHP one.

[bunch of stuff snipped]
That's what I would expect. It's bizzare, I get the right results in
$_FILES, but not in $_POST. How is that possible?

That's right... I shouldn't try to answer at midnight after I've been
out with the guys... :-)

Yes, it goes in the $_FILESarray, not $_POST.

Once I got some sleep and looked at this again this morning, it was
obvious :-). Sorry to steer you down the wrong path.

I'm confused about this. How does one associate an upload with
database info? In PHP 4, you could have a form that allowed multiple
form uploads with multiple fields for inputting multiple info:

----------------
Caption your images:

1.) caption input, file input
2.) caption input, file input
3.) caption input, file input
4.) caption input, file input
-----------------

In PHP 4, with a form like this, you knew which file went with which
caption, because the whole 2 dimensional array would show up in
$_POST.

How do you figure out the relationship in PHP5, if the files never
show up in $_POST? Does PHP 5 restrict you to just uploading one file
at a time, if you want to caption the file at the same time?


Sep 19 '07 #12

P: n/a
On Sep 19, 1:14 pm, lawrence k <lkrub...@geocities.comwrote:
On Aug 23, 8:55 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
lawrence k wrote:
On Aug 23, 12:05 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
>lawrence k wrote:
>>On Aug 22, 11:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>>>lawrence k wrote:
>>>>I've a form that starts off like this:
>>>><form method="post" action="profile.php?
>>>>id=5&formName=my_story_edit.htm" enctype="multipart/form-data">
>>>> <p>Email address:<br />
>>>> <input type="text" name="totalFormInputs[users][5][email_address]"
>>>>value="lawre...@krubner.com" /></p>
>>>> <p>Zip code:<br />
>>>> <input type="text" name="totalFormInputs[users][5][zip_code]"
>>>>value="22902" /></p>
>>>> <p>Personal image:<br />
>>>> <input type="file" name="totalFormInputs[users][5][upload_file]" /></
>>>>p>
>>>>Oddly enough, the "upload_file" has suddenly disappeared from the
>>>>uploaded array. When I hit $totalFormInputs with print_r, this is what
>>>>I get:
>>>>Array
>>>>(
>>>> [users] =Array
>>>> (
>>>> [5] =Array
>>>> (
>>>> [description] =I grew up in New Jersey.
>>>> [email_address] =lawre...@krubner.com
>>>> [zip_code] =22902
>>>> [time] =1187380627
>>>> )
>>>> )
>>>>)
>>>>Why is the file input not show up?
>>>>Everything was working fine a month ago, and now it is broke.
>>>>Any help is very much appreciated.
>If the HTML is correct, it should show up in the $_POSTvariable. But
>since it isn't, you have an HTML problem - not a PHP one.
[bunch of stuff snipped]
That's what I would expect. It's bizzare, I get the right results in
$_FILES, but not in $_POST. How is that possible?
That's right... I shouldn't try to answer at midnight after I've been
out with the guys... :-)
Yes, it goes in the $_FILESarray, not $_POST.
Once I got some sleep and looked at this again this morning, it was
obvious :-). Sorry to steer you down the wrong path.

I'm confused about this. How does one associate an upload with
database info? In PHP 4, you could have a form that allowed multiple
form uploads with multiple fields for inputting multiple info:

----------------
Caption your images:

1.) caption input, file input
2.) caption input, file input
3.) caption input, file input
4.) caption input, file input
-----------------

In PHP 4, with a form like this, you knew which file went with which
caption, because the whole 2 dimensional array would show up in
$_POST.

How do you figure out the relationship in PHP5, if the files never
show up in $_POST? Does PHP 5 restrict you to just uploading one file
at a time, if you want to caption the file at the same time?

No answers? I'm surprised by this. I assume I'm not the only PHP
programmer allowing people to upload more than one file at a time. I
had an easy enough time in PHP 4 but I can't figure out how to do this
in PHP 5. If an upload file doesn't appear in $_POST, how do you
associate the file info in $_POST?

Sep 21 '07 #13

This discussion thread is closed

Replies have been disabled for this discussion.