Why is $_SERVER['REQUEST_METHOD'] always GET?

后端 未结 1 1678

I\'m a bit confused about this. I\'m hoping it\'s something wildly obvious I\'ve missed! I have a very simple form:

相关标签:
1条回答
  • 2020-12-11 00:49

    Thanks to the comments to my question I have found the answer to be in apache configuration. It appears that, because the index.php file is inside a folder called page, apache will automatically redirect to the page with a slash on it. This is the default setting as seen in the Apache directorySlash documentation.

    As they warn against turning this off, I will just change the url to what I'm posting. Alternatively, of course, I could add a .htaccess file with proper rewrite rules setup.\

    Thanks for everyone's help! As a side note, Safari's inspector left me a little wanting in this case. Chrome turned out to be a far better option for testing.

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