Problems transferring data between PHP pages using POST

I am having a problem passing values ​​between pages in PHP using POST. I am using a hidden field at the bottom of the page to indicate the number of items (student rows) I have on the page. I also have a filter option that reduces the number of items visible on the page. When I submit data from a filtered page, all values ​​(including hidden ones) are not subject to any fear. When I submit data with an unfiltered page, the hidden values ​​are not getting through (and hence my data collection is not happening).

In clincher, this does not happen in an Apache based test environment, it only happens when I go to an IIS based production environment.

Here is a screenshot of the original page (actual data has been removed for privacy reasons) showing the inputs. There are 12 rows of 30 entrances each (360 in total): Data input page

Here is the HTML code with hidden fields that 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's the PHP code that gets 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 go out of the value of both $ numStudents and $ _POST ["numStudents"], nothing appears.

A really confusing thing - when I have a list of 1 or 2 students, the unfiltered data goes through without problem (echo displays the correct value). As mentioned earlier, if I filter the data so that only 6 columns of input are shown for each student, the data comes in without issue.

Does IIS have a maximum number of valid values ​​in the POST variable? If so, can this be changed? I checked the PHP.ini file and the max message size is set to 8M (which this data doesn't fit).

Is there any other setting that I need to change?

0


source to share


2 answers


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

Parameter in PHP.ini file: max_input_vars



I found this page helped to solve this problem:

$ _ Maximum size of POST array

0


source


The maximum size of POST data that can be sent depends on each server. For PHP / APACHE it can be set from .htaccess as:

#set max post size
php_value post_max_size 20M

      



In IIS, you want to change maxAllowedContentLength

See: http://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits

+1


source







All Articles