What causes an HTTP 405 “invalid method (HTTP verb)” error when POSTing a form to PHP on IIS?

后端 未结 11 1182
没有蜡笔的小新
没有蜡笔的小新 2020-11-29 12:05

I have one form in a PHP (5.2.9-1) application that causes IIS (Microsoft-IIS/6.0) to throw the following error when POSTed:

The page you are looking

11条回答
  •  臣服心动
    2020-11-29 12:32

    As drewm himself said this is due to the subsequent redirect after the POST to the script has in fact succeeded. (I might have added this as a comment to his answer but you need 50 reputation to comment and I'm new round here - daft rule IMHO)

    BUT it also applies if you're trying to redirect to a page, not just a directory - at least it did for me. I was trying to redirect to /thankyou.html. What fixes this is using an absolute URL, i.e. http://example.com/thankyou.html

提交回复
热议问题