troubleshooting Question

The file input in my form is not showing up when I submit the form

Avatar of lkrubner
lkrubnerFlag for United States of America asked on
PHP
5 Comments1 Solution197 ViewsLast Modified:
I've this form on one of my pages. Note that the name for the "file" input is the same as any other:



<form method="post" action="profile.php?id=5&formName=my_story_edit.htm" enctype="multipart/form-data">
            
      <p>My story:<br />
            <textarea name="totalFormInputs[users][5][description]">I grew up in New Jersey.  </textarea></p>

      
      <p>Email address:<br />
             <input type="text" name="totalFormInputs[users][5][email_address]" value="lawrence@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>

<input type="submit" value="Update" />

<input type="hidden" name="choiceMade[]" value="createRecordsForMultipleDatabaseTables" />

<input type="hidden" name="totalFormInputs[users][5][time]" value="1187380627" />

</form>




When this form submits, it triggers the function "createRecordsForMultipleDatabaseTables". At the top of that I get the variable $totalFormInputs. If I feed that to print_r(), I find that the "file" input has mysteriously disappeared:



Array
(
    [users] => Array
        (
            [5] => Array
                (
                    [description] => I grew up in New Jersey. I started drinking when I was 12. I stopped when I was 32.
                    [email_address] => lawrence@krubner.com
                    [zip_code] => 22902
                    [time] => 1187380627
                )

        )
)



Why is this happening? Where did it go?

I had this script working for a year. There have been some changes to the server, but none that I think would effect this.

Actually, this script is still working in most ways. The array tells the code to update record 5 in  the MySql table "users". That part works fine.

But where is the file input info?

I keep choosing different images, but nothing shows up. I've used both Macs, Windows and Ubuntu Linux to test this form.



ASKER CERTIFIED SOLUTION
raja_ind82

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros