Request method is GET instead of POST

  • Answered
This happens 'seemingly' randomly but quite often (about 1 in 50 requests).
When a form is posted (form method is 'POST') the server starts the request as 'GET' (in PHP $_SERVER['REQUEST_METHOD'] returns 'GET').
Of course, the result is that $_POST array is empty.

Please help, I have had this issue for years and I have no clue where it's coming from.
Hello, Thank you for your question about Request methods. Since the form is hard-coded, the method should not change. Most likely it is being hit by a bot. You can typically reduce the amount of bots using robots.txt file. You could also block unwanted traffic with an .htaccess file, if you know the source. If you have any further questions, feel free to post them below. Thank you, John-Paul