I am having problem in posting PHP (CI) from the view to controller. Have been surfing internet for quite a while but can't find any solution. I know that the maximum 1000 variable can be extended in the php.ini file(if i am not mistaken).
my form code
<?php
$i = 0;
foreach($data as $r){
if(!$r['supply']){
$i++;
echo "
<tr>
<td> <input type='text' class='form-control' name='index_number[]' value='".$r['index_number']."' placeholder='Index Number' readonly> </td>
<td> <input type='text' class='form-control' name='code[]' value='".$r['product_code']."' placeholder='Product Code' readonly> </td>
<td> <textarea style='resize:none'; rows='4' cols='50' readonly class='form-control' name='description[]' placeholder='Product Description'> ".$r['product_description']."</textarea> </td>
<td> <input type='text' class='form-control' name='qty[]' value='".$r['product_qty']."' placeholder='Qty' readonly> </td>
<td> <input type='text' class='form-control' name='uom[]' value='".$r['product_uom']."' placeholder='UOM' readonly> </td>
<td> <input type='text' class='form-control' name='price[]' value='".$r['product_price']."' placeholder='Price'> </td>
<td> <textarea style='resize:none'; rows='4' cols='50' class='form-control' name='remarks[]' placeholder='Product Remarks'> ".$r['product_remarks']."</textarea> </td>
<td> <input type='hidden' name='product_id[]' value='".$r['product_id']."'></td>
</tr>
";
}
}
?>
my ajax function
<script>
function postData(){
$.ajax({
type: "post",
url: "<?php echo base_url('url/processForm') ?>",
cache: false,
data: $('#quotationRequest').serialize(),
success: function(response){
$("body").html(response);
},
error: function(){
alert('Error while request..');
}
});
}
</script>
How to write an ajax code that will post the data from the PHP view to controller per 100 data? So in total, the ajax will post data 10 times (total 1000 data).
Thank you