2

I want to post multiple values:

index.php:

<form action="update.php" method="post">
<input name='name[]' value='1'/>
<input name='name[]' value='2'/>
<input name='name[]' value='3'/>
<input name='name[]' value='4'/>
<input name='name[]' value='5'/>
<input name='name[]' value='6'/>
<input name='name[]' value='7'/>
<input name='name[]' value='8'/>
<input name='name[]' value='9'/>
<input name='name[]' value='10'/>
<input name='name[]' value='11'/>
<input name='name[]' value='12'/>
<input name='name[]' value='13'/>
<input name='name[]' value='14'/>
<input name='name[]' value='15'/>
<input name='name[]' value='16'/>
<input name='name[]' value='17'/>
<input name='name[]' value='18'/>
<input name='name[]' value='19'/>
<input name='name[]' value='20'/>
</form>

update.php

if ($_POST['name']) {
    foreach ( $_POST['name'] as $key=>$value ) {
        echo $_POST['name'][$key];
   }
} 

My problem is that somehow the posting is limited to 20. When I add another input field <input name='name[]' value='21'/> then the output is still only 20 items. I have no idea why this is happening.

1 Answer 1

3

In your server there can be the max_input_vars value setted at 20.

Change that value by creating a .htaccess file in the dir where the script run and insert into:

php_value max_input_vars 100

Read more at http://php.net/manual/en/info.configuration.php#ini.max-input-vars.

Sign up to request clarification or add additional context in comments.

1 Comment

Ok, good idea. I will test it now and let you know if it worked

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.