0
<form method="post">
<?php
for($i = 1; $i <= 1000; $i++)
{
    for($j = 1; $j <= 100; $j++)
    {
        echo "<input type=\"text\" name=\"text" . $j . "[]\" value=\"" . ($i * $j) . "\" />";
    }
}
?>
<input type="submit" />
</form>

Why only get 10 rows output when post 1000 rows? Already set all variable in php.ini like input_max_var, max_execution_time, max_post_limit etc...

OUTPUT

Array
(
    [text1] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
            [3] => 4
            [4] => 5
            [5] => 6
            [6] => 7
            [7] => 8
            [8] => 9
            [9] => 10
        )
    [text2] => Array
        (
            [0] => 2
            [1] => 4
            [2] => 6
            [3] => 8
            [4] => 10
            [5] => 12
            [6] => 14
            [7] => 16
            [8] => 18
            [9] => 20
        )
    .
    .
    .
    [text100] => Array
        (
            [0] => 100
            [1] => 200
            [2] => 300
            [3] => 400
            [4] => 500
            [5] => 600
            [6] => 700
            [7] => 800
            [8] => 900
            [9] => 1000
        )
)
memory_limit = -1
post_max_size = 1G
max_execution_time = -1
max_input_time = -1
max_input_vars = -1
suhosin.post.max_vars = -1
suhosin.request.max_vars = -1
8
  • probably you forgot to save the file before running it. Commented May 26, 2018 at 9:00
  • No problems are occur during few days and 100 data are post only.. Commented May 26, 2018 at 9:09
  • it works as expected here. Commented May 26, 2018 at 9:35
  • Can you give me php.ini configuration? Commented May 26, 2018 at 13:21
  • This looks like a programmng question! Commented May 26, 2018 at 15:42

1 Answer 1

1

So you have 100 000 inputs on the page but their names are invalid - there are duplicates on the page. It should be combination of $i and $j

<form method="post">
<?php
for($i = 1; $i <= 1000; $i++)
{
    for($j = 1; $j <= 100; $j++)
    {
        echo "<input type=\"text\" name=\"text" . ($j * $i) . "[]\" value=\"" . ($i * $j) . "\" />";
    }
}
?>
<input type="submit" />
</form>
Sign up to request clarification or add additional context in comments.

1 Comment

it just a name if i am use only html then also problms occured.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.