$_POST Not Getting All Inputs

software development

#1

I am working on an attendance sheet for our church. My form has Date, Event & Section as drop drop downs and then I build a list of members/regular attendees from the database. Next to the name(s) are 2 check boxes. One for “Present” and another for “Guest”.

My problem is that when users hit the submit button only 997 items are in my array when I am expecting 3153. I have increased the post_max_size to 500M, but that doesn’t solve my issue. In my php the line [php]echo "Size = ".count($Contact_ID);[/php] constantly returns 997.

Here is my form…
[php]
<?php $row_count = 1; do { ?>

								<tr width="100%" <?php if ($row_count%2) { ?>bgcolor="#F4F4F4"<?php }; ?>>
								<td class="list" style="padding-left:5px">
									<?php
										$letter = strtoupper($row_contactlist['contact_last'][0]);
										if ( $letter != $last_letter ) {
											echo '<a name="index', $letter, '"></a>';
											$last_letter = $letter;
										}
											echo $row_contactlist['contact_last']; ?>, <?php echo $row_contactlist['contact_first']; ?>
									<?php if($row_contactlist['contact_middle'] != NULL){ ?> <?php echo $row_contactlist['contact_middle'] ?> <?php } ?>
								</td>
								<input type="hidden" name="ContactID[]" value="<?php echo $row_contactlist['contact_id']; ?>" readonly="readonly">
								<td>
									<input type="checkbox" name="Present[]" value="Yes" />
								</td>
								<td>
									<input type="checkbox" name="Visitor[]" value="Yes" />
								</td>
								</tr>

						<?php $row_count++; } while ($row_contactlist = mysqli_fetch_assoc($contactlist)); ?>
						</ul>
					</table>
				</div>
				<div style="position:fixed; bottom:.5in; left:0;"><input type="submit"></div>
			</div>
	</form>

[/php]

And my php…
[php]
//add attendance
if (isset($_POST[‘date’]) && isset($_POST[‘event_list’])) {
// echo “Entered IF”;
$Contact_ID = $_POST[‘ContactID’];
$Present = $_POST[‘Present’];
$Visitor = $_POST[‘Visitor’];
$counter = 0;
echo "Size = ".count($Contact_ID);
// $attendeeList = $_POST[‘attendeeList’];
foreach ( $Contact_ID as $key => $ii ){
//echo “entered Loop”;
$counter++;
// echo "Counter = ".$counter;
$contact = $ii;
$event = $_POST[‘event_list’];
$dt = date_create($_POST[‘date’]);
if ($dt !== null)
{
$date = $dt->format(‘Y-m-d’); // insert this value
}
$section = $_POST[‘section_list’];
if( $section == “empty”) { $section = NULL; }

// echo "Contact = ".$contact;
// echo "Present = ".$Present[$key];

	$present = $Present[$key];
	$visitor = $Visitor[$key];

	if($present == 'Yes'){
		$present = 1;

// echo "present = FOUND ONE WITH ".$present;
}

		if($present == 1){
			$strQueryAttend = "SELECT count(*) AS 'count' FROM attendance WHERE attendance_date = '".$date."' AND attendance_contact = ".$contact." ";

// echo "\n strQueryAttend = ".$strQueryAttend;
$attendcount = mysqli_query($dbLink, $strQueryAttend) or die(mysql_error());
$row = mysqli_fetch_object($attendcount);
$attendcount = $row->count;
$attendcount = mysqli_num_rows($attendcount);
//echo “attend1count value =”.$attendcount;

				if($attendcount == 0 ){
						$strQuery = "INSERT INTO attendance (attendance_event, attendance_contact, attendance_present, attendance_visitor, attendance_date, attendance_section) VALUES
							(
								".$event.",
								".$contact.",
								".$present.",
								".$visitor.",
								'".$date."',
								'".$section."'
							)";

// echo " Query: ".$strQuery;

					mysqli_query( $dbLink, $strQuery);
					echo "record written";
				$rolid = mysqli_insert_id($dbLink);
				}
		}
}
//$update = true;

}
// end add attendance
[/php]
[hr]
Turns out that max_input_vars was set to 1000. I bumped it up and that resolved my issue.