SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    lots of $_POST array elements are missed

    Hello,

    I have a form on my PHP script that has a large number of CHECKBOX fields (about 100). On some websites of my clients, when the form is submitted, the script can not receive all the elements of the $_POST array. lots of the elements are missed. i.e. It receives the first 20 element only.

    I tried to increase post_max_size in php.ini file but the problem still there.

    What may cause this problem? and what are the suitable PHP configration to handle these forms?


    Any help would be much appreciated. Thanks in advance.

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2005
    Location
    Winnipeg
    Posts
    498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are the checkboxes arrays?

    HTML Code:
    <input type="checkbox" name="option[]" value="1" />
    The only constant in software is change itself

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes.

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Validate your html.

    Also, if you have really deep arrays like

    name="foo[bar][baz][qux]...etc..."

    Then you may need to adjust max_input_nesting_level

  5. #5
    SitePoint Guru bronze trophy TomB's Avatar
    Join Date
    Oct 2005
    Location
    Milton Keynes, UK
    Posts
    996
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    If your php installation is running suhosin check suhosin.post.max_vars.

  6. #6
    SitePoint Enthusiast
    Join Date
    Aug 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi crmalibu,
    Thank you for your comment. they are not deep arrays, they're only one-level arrays but they are a lot.

    TomB,
    Thanks, the hosting is running suhosin already and I found that the suhosin.post.max_vars=200. I'll try to increase it and see the result.

    PCSpectra,
    Do you have any comments about the checkboxes arrays?

    Thankx all. I appreciate your comments.

  7. #7
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Checkboxe values are only returned in POST if they are checked.
    Are all 100 being checked?


Bookmarks

Posting Permissions

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