duanhuang4841 2016-05-09 05:11
浏览 160
已采纳

警告使PHP忽略$ _POST

When submitting a form with file attachment that exceeds the POST Content-Length limit I get the following warning

Warning: POST Content-Length of 143854246 bytes exceeds the limit of 134217728 bytes in Unknown on line 0

My issue is that for some reason PHP acts as if $_POST['form_input_field'] does not exist and I get this error

Undefined index: form_input_field ...

The inputs exist and contain values, and if the file does not exceed the limit, PHP gets it just fine.

I solve the issue by adding isset isset($_POST['form_input_field']). but is there an explanation as to why PHP can't get $_POST['form_input_field']?

EDIT:

I don't have a problem with the limit and don't want to increase it.

EDIT I have no intention of increasing the upload limit. I simply want to know why PHP thinks $_POST['form_input_field'] does not exist after the warning.

  • 写回答

2条回答 默认 最新

  • dqiz20794 2016-05-09 05:33
    关注

    To answer the actual question "Is there an explanation as to why PHP can't get input?" under the circumstance of "I don't have a problem with the limit and don't want to increase it." :

    It's a weird behavior of PHP, which removes all other POST data in case you exceed that limit. It is possibly like that because if one part of the POST violates the rules, the POST is rendered invalid all-together (which makes sense)

    If the size of post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty.

    You can read about it here http://php.net/manual/en/ini.core.php#ini.post-max-size

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 springboot 3.0 实现Security 6.x版本集成
  • ¥15 PHP-8.1 镜像无法用dockerfile里的CMD命令启动 只能进入容器启动,如何解决?(操作系统-ubuntu)
  • ¥15 请帮我解决一下下面六个代码
  • ¥15 关于资源监视工具的e-care有知道的嘛
  • ¥35 MIMO天线稀疏阵列排布问题
  • ¥60 用visual studio编写程序,利用间接平差求解水准网
  • ¥15 Llama如何调用shell或者Python
  • ¥20 谁能帮我挨个解读这个php语言编的代码什么意思?
  • ¥15 win10权限管理,限制普通用户使用删除功能
  • ¥15 minnio内存占用过大,内存没被回收(Windows环境)