www.webdeveloper.com
Results 1 to 6 of 6

Thread: Arrays being posted in forms

  1. #1
    Join Date
    Apr 2007
    Posts
    98

    Arrays being posted in forms

    Hi

    I have a form that basically lists out a 26 week timetable (182 days). Each day allows a user to select 5 different drop down menus.

    The drops downs are named like as follows:

    morning[$i]
    lunch[$i]
    afternoon[$i]

    When I use the $_POST['morning'] for example and then perform a print_r on this, I get 182 values. Thats what I want

    The problem is, if I add more drop downs, for some reason, the number of values returned in each array falls (i.e. only 162 values - so the last 20 are missed). I have no idea how to fix this. Does it sound more like a memory issue

    Many Thanks

  2. #2
    Join Date
    Nov 2012
    Posts
    9
    bookmarked this thread as it sounds interesting.

  3. #3
    Join Date
    Oct 2010
    Location
    Ohio
    Posts
    233
    You should have a look at the following directives in your php.ini (possibly putting them here as well for review)

    max-input-vars
    memory-limit
    post-max-size

    From the sounds of it, its probably the first one (max-input-vars) though. Hope that helps!
    ~Ryan
    www.rdennispallas.com <-- Personal Site, changing regularly cuz its ugly.

  4. #4
    Join Date
    Apr 2007
    Posts
    98
    Thanks for the help.

    I have heard people talk about the .ini file many times.

    I am currently hosting the site with a 3rd party. I cant see the .ini file in any of the directories, is this something they would have to change?

    Thanks

  5. #5
    Join Date
    Oct 2010
    Location
    Ohio
    Posts
    233
    That depends on your host, some allow you to use a php.ini on a per directory basis by just putting one in the root. For example, on my customer's server it didn't have a php.ini file in his folder to begin with, but we created one and uploaded it and all worked well. You'll have to check with your host about that.

    Have you thought about breaking up the form into multiple parts? A form with 500+ inputs seems a little overwhelming for a user.
    ~Ryan
    www.rdennispallas.com <-- Personal Site, changing regularly cuz its ugly.

  6. #6
    Join Date
    Apr 2007
    Posts
    98

    resolved

    Thanks

    This issue has been SOLVED. The max var limit was set to 1000. I simply uploaded a php.ini file to my main directory and changed this to 2000. Everything works well now.

    Thanks

    All

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