php $_POST array empty upon form submission

前端 未结 27 2648

I have a custom CMS i\'ve built that works perfectly on my dev box (Ubuntu/PHP5+/MySQL5+).

I just moved it up to the production box for my client and now all form su

相关标签:
27条回答
  • 2020-11-22 10:09

    This is sort of similar to what @icesar said.

    But I was trying to post stuff to my api, located in site/api/index.php, only posting to site/api since it gets passed on to index.php by itself. This however, apparently cause something to get messed up, as my $_POST got emptied on the fly. Simply posting to site/api/index.php directly instead solved it.

    0 讨论(0)
  • 2020-11-22 10:10

    I had a similar problem. Turned out to be a simple fix. In the form I had

    <form action="directory" method="post">

    where directory was the name of... the directory. My POST array was totally empty. When I looked at the url in my browser, it was displayed with a forward slash on the end.

    Adding the forward slash to the end of my action did the trick -

    <form action="directory/" method="post">

    My $_POST array was full again!

    0 讨论(0)
  • 2020-11-22 10:10

    I just spent hours to fix a similar issue. The problem in my case, was the the

    max_input_vars = "1000"
    

    by default, in the php.ini. I had a really huge form without uploads. php.ini is set to upload_max_filesize = "100M" and post_max_size = "108M" and it was surely not the issue in my case. PHP behavior is the same for max_input_vars when it exceeds 1000 variables in the form. It returns and empty _POST array. I wish I could have found that one hours, and hours ago.

    0 讨论(0)
提交回复
热议问题