dtch60248 2016-11-08 04:15
浏览 12

PHP ajax发布大数据处理

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

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 软件测试决策法疑问求解答
    • ¥15 win11 23H2删除推荐的项目,支持注册表等
    • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
    • ¥15 qt6.6.3 基于百度云的语音识别 不会改
    • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
    • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
    • ¥15 lingo18勾选global solver求解使用的算法
    • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
    • ¥20 测距传感器数据手册i2c