The problem is when i am adding the more than 624 stickers.
The code works fine when the stickers are less than 624. it seems to not allow for more stickers.
I seem to be having a strange error that i cant fix.
the error i keep getting is: Undefined offset: 624
this is what i have:
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
im not sure why it is not working for adding more than 624 stickers please help!