www.webdeveloper.com
Results 1 to 5 of 5

Thread: Undefined index: file21

  1. #1
    Join Date
    Feb 2011
    Posts
    83

    Undefined index: file21

    Hi there,

    When you look at the "View Page Source", you see these following html sentences:

    Code:
    <input type="file" name="file21" id="file21" size="80" />
    <input type="file" name="file22" id="file22" size="80" />
    <input type="file" name="file23" id="file23" size="80" />
    PHP still complains "Undefined index: file22". For the first 20 files, all work fine but starting file21, it begins complaints. What's the problem. Is there a configuration on how many files are allowed in a session?

    Thanks,

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,616
    No, it's probably a simple syntax error in your PHP, nothing to do with the form mark-up you've shown us.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Jun 2006
    Location
    Under your bed
    Posts
    357
    Hmm, is there anywhere else in your code that says "file22" other than the snippet you showed us?

  4. #4
    Join Date
    Feb 2011
    Posts
    83
    Thanks each of you responses. I have figure out the resolution: just add the following line to php.ini:

    max_file_uploads=30.

    The default is 20. You can see this configuration parameter at the PHP Core section of phpinfo().

    Thanks,

  5. #5
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,616
    Heh...I didn't even notice they were all file-type inputs -- not that I would necessarily have known what the problem was. Glad you figured it out.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles