使用ajax或普通发布时,查看max_input_vars会有区别吗?

使用ajax或普通发布时,查看max_input_vars会有区别吗?

问题描述:

html

<form id="saveform" method="post" action="saveform">
{a whole lot of input element}
<input type="submit" value="normal submit">
</form>

jQuery

var data = $('#saveform').serialize();
$.post('saveform', data);

Is there any difference in how server handles max_input_vars if I

  1. Post normal submit by clicking on submit-button in html above?
  2. Posting entire form through ajax with jQuery above?

Would the same limit apply (for max_input_vars)?

UPDATE A client of mine has a system I've built at a webhotell that has max_input_vars set to 1000 and I'm looking for a workaround because the webhotell refuses to change this number (and it's not possible to change with htaccess or php.ini). In worst case I would have to transfer my client to another webhotell but I'd rather not if there is an easy workaround.

html strong> p>

 &lt; 表单id =“saveform”method =“post”action =“saveform”&gt; 
 {n}一大堆输入元素} 
&lt; input type =“submit”value =“normal submit”&gt; 
&lt; / form&gt  ; 
  code>  pre> 
 
 

jQuery strong> p>

  var data = $('#saveform')  .serialize(); 
 $ .post('saveform',data); 
  code>  pre> 
 
 

服务器处理 max_input_vars code的方式有什么不同 >如果我 p>

  1. 通过点击上面的html中的提交按钮发布正常提交? li>
  2. 通过ajax上面的jQuery发布整个表单? li> ol>

    是否适用相同的限制( max_input_vars code>)? p>

    UPDATE 我的客户端有一个我在webhotell上构建的系统,其 max_input_vars code>设置为1000,我正在寻找一种解决方法因为webhotell拒绝改变这个数字(而且它是 不可能用htaccess或php.ini更改)。 在最坏的情况下,我将不得不将我的客户端转移到另一个webhotell,但如果有一个简单的解决方法,我宁愿不要。 p> div>

i shall summarize the comments suggestions for future visitor reference:

the setting: max_input_vars

Suggestions

  • Combine multiple inputs send as one, split on server (Barmar,charlietfl )

  • slit the data, make multiple post requests (Dagon)

  • as the limit is applied to $_GET, $_POST and $_COOKIE superglobal separately, you can send half post and half get. (Dagon)

  • Change to a host that lets you make the changes you need for the client (Dagon). Most ideal if available

  • Send data in post body and extract with file_get_contents('php://input'). Would have empty $_POST (charlietfl)