0

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): Data input page

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?

Tristan
  • 153
  • 2
  • 11

1 Answers1

1

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: http://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits

shaunakde
  • 3,009
  • 3
  • 24
  • 39
  • My maxAllowedContentLength was set to 30,000,000 bytes, which should be more than enough. I did try changing it to 60,000,000 just in case, but this did not fix my issue. Your answer did help me though as it enabled my to frame to search query a lot more effectively. Thanks. – Tristan Dec 04 '14 at 00:57