PHP - 数组中的70后,可变后迷路 [英] PHP - Post getting lost after 70th variable in the array

查看:146
本文介绍了PHP - 数组中的70后,可变后迷路的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我已经花了路长试图弄清楚这一点。我有一个while循环,从数据库中提取的行和回声为每一个输入与 selected_id [] 作为名称。在提交我使用$ _REQUEST收集选定的复选框,但由于某些原因,没有输入的变量70之后将发布。 selected_id [0] selected_id [70] 将张贴就像正常的,但 selected_id [71 ] 和更高的则不会。

Okay, I've spent way to long trying to figure this out. I have a while loop that takes rows from a database and echos an input for each one with selected_id[] for the names. On submit I use $_REQUEST to collect the selected checkboxes, but for some reason, none of the inputs after the 70th variable will post. selected_id[0] through selected_id[70] will post just like normal but selected_id[71] and higher will not.

为什么我只能_REQUEST $数组到数组中的第70变量??

Why am I only able to $_REQUEST an array up to the 70th variable in that array??

如果我从数据库中删除的条目之一,则仍然会出现在第71项中的问题呼应或 selected_id [70]

If I remove one of the entries from the database, then the problem will still occur at the 71st entry echoed or selected_id[70]

我使用的PHP版本5.3.15和我max_input_vars设置为1000。我max_input_nesting_level设置为64,但我不认为是什么导致了问题。我memory_limit的设置为20M。

I'm using PHP Version 5.3.15 and my max_input_vars is set to 1000. my max_input_nesting_level is set to 64, but I don't believe that is whats causing the problem. My memory_limit is set to 20M.

下面是我的大部分code:

Here is the majority my code:

<?php


   if(!empty($_REQUEST[assignedprocess])){

    $selected_id = $_REQUEST[selected_id];
    $howmany = count($selected_id);
    $msgback="(".$howmany.") Entry(ies) updated. <br>";
      echo $msgback; 
   }

?>

<form action="index.php" method="post" name="index">

    <?php

        while($row = mysql_fetch_array($result_groups)){

        echo "<input name="selected_id[]" type="checkbox" value="'.$row[id].'" />";

        }

    ?>
<input type="hidden" name="assignedprocess" value="11">
<input type="submit" name="subs" value="Apply">  
</form>

对不起,我的马虎code和可怕的英文...我真的AP preciate任何帮助,您可以给,先谢谢了。

Sorry for my sloppy code and horrible English... I really appreciate any help you can give, thanks in advance.

推荐答案

设置php_value post_max_size要成为在php.ini 15M(或更多):

php_value post_max_size 15M

修复code:(您错过回声功能)

<form action="index.php" method="post" name="index">

    <?php

        while($row = mysql_fetch_array($result_groups)){
          $id= $row[id];
          echo  "<input name='selected_id[]' type='checkbox' value= $id />";



        }

    ?>
<input type="hidden" name="assignedprocess" value="11">
<input type="submit" name="subs" value="Apply">  
</form>

这篇关于PHP - 数组中的70后,可变后迷路的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆