Issues transfering data between PHP pages with POST


I am having an issue transferring values between pages in PHP using POST. I am using a hidden field at the bottom of a page to state how many items (rows of students) I have on the page. I also have a filter option which reduces the number of items visible on the page. When I submit data from the filtered page, all values (including the hidden ones) get through no worries. When I submit data with the page unfiltered, the hidden values do not get through (and therefore my data collection does not happen).

The clincher is, this does not happen in my Apache based test environment, it only happens when I move this to an IIS based production environment.

Here is a screen shot of the initial page (actual data has been removed for privacy reasons), which shows the inputs. There are 12 rows of 30 inputs each (360 total): <img alt="Data input page" class="b-lazy" data-src="https://i.stack.imgur.com/QYjXW.png" data-original="https://i.stack.imgur.com/QYjXW.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />

Here is the HTML code with the hidden fields which I need:

<input type="hidden" value="12" name="numStudents"> <input type="hidden" value="10" name="numTasks"> <input type="hidden" value="3" name="numCriteria"> <input class="btn btn-primary btn-large" type="submit" value="Save" name="submit">

Here is the PHP code which receives the values:

//Get the general information from the form $numStudents = $common->clean($_POST["numStudents"], $CON); $numTasks = $common->clean($_POST["numTasks"], $CON); $numCriteria = $common->clean($_POST["numCriteria"], $CON); //Loop to get grades for all students $output = ""; $flagChange = FALSE; $count = 0; for($i = 0; $i < $numStudents; $i++)

When I echo out the value of either $numStudents or $_POST["numStudents"] directly, nothing appears.

The really confusing thing is - when I have a list of 1 or 2 students, the unfiltered data comes through without an issue (the echo displays the correct value). As mentioned before, if I filter the data so that only 6 columns of inputs are shown for each student, the data comes through without an issue.

Does IIS have a maximum number of values allowed in the POST variable? If so, can this be changed? I have checked my PHP.ini file and the max size of post is set to 8M (which this data should not even approach).

Is there another setting somewhere I need to change?


The maximum size of POST data that can be sent is a per server setting. For PHP/APACHE it can be set from the .htaccess as:

#set max post size php_value post_max_size 20M

Under IIS you want to change the maxAllowedContentLength

See: <a href="http://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits" rel="nofollow">http://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits</a>


So, I was able to re-frame my search query to find a solution to this. It turns out that there is a setting in PHP for the maximum number of elements allowed within the POST array. My limit was set to the default of 1000, I have now upped this to 3000.

The setting in the PHP.ini file is: max_input_vars

I found this page helped solve this issue:

<a href="https://stackoverflow.com/questions/9807100/post-max-array-size" rel="nofollow">$_POST max array size</a>


  • Can Delphi XE4 support iOS 4.x?
  • Retina 4 2x is never used for iPhone 5 simulator in Xcode 6.2 image asset
  • strptime in Javascript
  • Substitute partial line in vim using only substitute command
  • Implementing HMAC-SHA256 for Keybase in Javascript
  • Efficient & Pythonic way of finding all possible sublists of a list in given range and the minim
  • SQL: Getting the physical size of a subset of a table
  • Recording values of radio buttons in ember
  • Can my PDF ping my server when it is opened?
  • Access user's phone number on iOS 7
  • pip in virtualenv gets ConnectTimeoutError
  • Application level floating views with navigation in Android
  • GAE: Way to get reference to an HttpSession from its ID?
  • AndEngine Applying Transparancy to AndEngine View
  • Using a canvas object in a thread to do simple animations - Java
  • Marklogic : Query response time is very high
  • Avoid links criss cross / overlap in d3.js using force layout
  • How can I send an e-mail from a vbs script
  • Sails.js/waterline: Executing waterline queries in toJSON function of a model?
  • Can Jackson SerializationFeature be overridden per field or class?
  • Controls, properties, events and timers running in design time
  • Updated Ionic CLI but shows previous version (Windows)
  • How can I estimate amount of memory left with calling System.gc()?
  • Matrix multiplication with MKL
  • How to get icons for entities from eclipse?
  • File upload with ng-file-upload throwing error
  • Proper way to use connect-multiparty with express.js?
  • Benchmarking RAM performance - UWP and C#
  • Load html files in TinyMce
  • Acquiring multiple attributes from .xml file in c#
  • how does django model after text[] in postgresql [duplicate]
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Setting background image for body element in xhtml (for different monitors and resolutions)
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How can I remove ASP.NET Designer.cs files?
  • JaxB to read class hierarchy
  • costura.fody for a dll that references another dll
  • Observable and ngFor in Angular 2
  • UserPrincipal.Current returns apppool on IIS
  • java string with new operator and a literal