在较新的PHP-Versions中,每个公式(POST)的输入文件数将限制为1000(未验证的信息).它接缝已经在5.2的某些版本中安装了此限制.这在我们的网上商店引起了很多问题.
有人知道更多关于它以及这个限制是否会受到参数或Vars的影响.我刚刚找到了max_input_vars,但它似乎是一个完整的新变量5.4.RC4而且我不确定,如果这个var将是POST方法的变量.
Sla*_*vic 59
max_input_vars
Run Code Online (Sandbox Code Playgroud)
是PHP尝试解决一些安全问题,在设置时,它会限制您的输入数量(因此,表单中的字段).还要注意
max_input_nesting_level
Run Code Online (Sandbox Code Playgroud)
是的 - 它们是可配置的.只需编辑您的php.ini或htaccess值.
Ony*_*nyx 31
我也遇到过这个问题,正在进行代码的本地化安装,Debian Sid已升级到5.4 RC4 PHP.一个超过7000行的复选框(!)的形式突然只在$ _POST数据中处理了1001个......头部刮了几个小时.
在/etc/php5/apache2/php.ini中进行了更改:
max_input_vars = 5000
Run Code Online (Sandbox Code Playgroud)
保存,然后重新启动apache,现在一切都很好.
如果您不能/不想增加服务器限制,这是另一种解决方案
<!-- 10000 checkboxes outside the FORM. You do not want to post this -->
<input class="cbox" type="checkbox" value="1" id="id-1" checked name="id[]">
....
<input class="cbox" type="checkbox" value="10000" id="id-10000" checked name="id[]">
<form method="POST" action="postpage.php">
<input type="hidden" id="cboxes" name="cboxes" class="cboxes" value="" />
<input type="submit" onclick="return clicked();">
</form>
Run Code Online (Sandbox Code Playgroud)
然后使用jquery
<script>
function clicked() {
var cb = $('.cbox:checked').map(function() {return this.value;}).get().join(',');
$('#cboxes').val(cb);
return true;
}
</script>
Run Code Online (Sandbox Code Playgroud)
使用POST我测试了发布10000条记录.
在服务器中
$cboxes = $_POST['cboxes'];
$cbox_exp =(explode(',', $cboxes));
print_r(count($cbox_exp)); //gives me 10000
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
53799 次 |
最近记录: |