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条)

报告相同问题?

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样