未定义的偏移量:624

色板360

问题是当我添加超过 624 个贴纸时。

当贴纸小于 624 时,代码工作正常。似乎不允许更多贴纸。

我似乎遇到了一个我无法修复的奇怪错误。

我不断收到的错误是:未定义的偏移量:624

这就是我所拥有的:

php:

 //product names
        for ($x = 0; $x < $counter; $x++) {

            $product[] = $_POST["product_name"][$x];
            $product_price[] = preg_replace('/\s+/', '', $_POST["product_price"][$x]);
            $product_barcode[] = preg_replace('/\s+/', '', $_POST["product_barcode"][$x]);
            $product_stickers[] = preg_replace('/\s+/', '', $_POST["product_stickers"][$x]);
            $vendor_code[] = $result = $this->getUsername($user_id, $x);

        }

 $result = array();
                $values = array($product, $product_price, $product_barcode, $vendor_code, $product_stickers);
                //$values = array($product, $product_price, $product_barcode, $vendor_code);

                foreach ($products as $index => $key) {
                    $t = array();
                    foreach ($values as $value) {

                        $t[] = $value[$index];

                    }

                    $result[$key] = $t;
                }

                $products_json = json_encode($result);

html:

    @for($x = 0; $x <= 650; $x++)

    <tr>
    <td><input type="text" name="product_name[]" class="product_name"
        value="{{$x}}"></td>

    <td><input type="text" name="product_price[]" class="product_price"
         value="{{$x}}"></td>

    <td><input type="text" name="product_barcode[]"  

        class="product_barcode"
        value="{{$x}}"></td>

   <td><input type="text" name="product_stickers[]"  

       class="product_stickers"
       value="{{$x}}"></td>

   <td><a role="button" style="color:#fff" class="delRowBtn btn btn-  

    warning">Remove</a>
   </td>

   </tr>

    @endfor

我不知道为什么添加超过 624 个贴纸不起作用,请帮忙!

达瓦尔·普罗希特

可能是您发布了更多数据,然后允许在php.ini例如。增加post_max_sizemax_input_vars

这将解决我猜的问题。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章