mardi 23 décembre 2014

PHP - Selected Checkboxes are not completely passed into $_POST-Array

just a short overview what i want to do:


I have a "Gridview" containing cargodata from a mysql-db. The Grid contains a checkbox with the cargoid as value for each single row. Now the user have the option to select multiple cargo-elements and generate a pdf with the collis and some other informations.


Here's a snippet of the grid how it is built via php:



<table>
<tr id="first"></tr>
<?php

$collection = $_barcode->getBarcodeCollection($_SESSION['sort'], $_SESSION['order']);

foreach ($collection as $row)
{
echo "<tr class='datarow'>";
echo "<td><input type='checkbox' name='select[]' value='".$row['id']."' /></td>";
echo "<td onclick=''>".$row['sku']."</td>";
echo "<td>".$row['colli_']."/".$row['colli']."</td>";
echo "<td>".$_man->getManufacturerById($row['manufacturer'])."</td>";
echo "<td>".$row['barcode']."</td>";
echo "</tr>";
}
?>
</table>


This works fine so far if i select only a few entries. My database table now has ~ 4.000 Entries, so when i select all elements in the grid it only can pass 1.000 elements to the $_POST-Array, because php has set the max_input_vars to 1.000 by default.


And here is the part, where i get and process the values from the checked checkboxes:



if ($_POST['formaction'] == "generateBarcodes")
{
$barcodedata = $_POST["select"];
$_ev = new Eventmgr();
if($barcodedata!=null)
{
$barcodeitems = array();
$data = array();

// get all selected barcodes
foreach ($barcodedata as $item)
{
$barcodeitems[] = $_barcode->getBarcodeById($item);
}

// Create an array which holds all data seperated by manufacturer
foreach($barcodeitems as $i)
{
$data[$i["manufacturer"]][] = $i;
}

$_ev->logEvent("Begin with generating process....",1);
$pdfgen = new generatepdf($data);
$pdfgen->generatePDF();
}
else
{
$_ev->logEvent("Keine Barcodes ausgewählt!",2);
}
}


So whats the problem now?


I've had set the max_input_vars to 6.000 and restartet the machine where my debian runs. But afterall it only selects ~900 selected checkboxes and ignores the other ~3.000 checkboxes even if they were selected.


So now im not sure what is going wrong there, i don't have the missing checkbox values inside the $_POST-Array before i process the data.


I hope someone can give me some hint or advice.


Thanks in advance and best regards tireniets





Aucun commentaire:

Enregistrer un commentaire