PHP $_POST not working but $_GET works fine

后端 未结 3 1016
我在风中等你
我在风中等你 2020-12-06 16:47

I\'m trying to build a simple login system using

. Everything works fine on MAMP on my laptop but when I upload the script to the se
相关标签:
3条回答
  • 2020-12-06 17:31

    I got it fixed eventually, figure I might as well post what worked here in case someone else has the same problem in future.

    Turns out one of these HTTP modules was interfering with POST:

    RadCompression
    RadUploadModule

    With these modules turned off, POST worked fine.

    (NB this was on a totally new app where I knew there wasn't any existing code that might have depended on one of those modules... turning them off may have unintended consequences I'm not aware of, YMMV.)

    0 讨论(0)
  • 2020-12-06 17:38

    One possibility is that POST is not an allowed verb on the server:

    http://www.iis.net/configreference/system.webserver/security/requestfiltering/verbs

    0 讨论(0)
  • 2020-12-06 17:40

    I've had the same problem with $_POST being empty/NULL, and after spending 30 minutes searching SO and Google I finally found a solution that worked for me.

    Since I don't know how to change the php.ini file for MAMP I edited my htaccess to include this:

    php_value post_max_size 60M
    php_value upload_max_filesize 60M
    

    and I can var_dump($_POST) with the submitted input fine now.

    Reference link: http://helpfulcoder.blogspot.ca/2011/01/empty-post-array-in-mamp.html

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