Form sends GET instead of POST

后端 未结 2 774
陌清茗
陌清茗 2020-12-19 01:33

I have searched the all questions with similar title, no solution for me yet.

I have a website running on apache2. I need to submit sensitive information through a

2条回答
  •  情深已故
    2020-12-19 01:54

    If like me you gone from Routed url (like in Laravel) to plain PHP, and wonder why the file /user/store/index.php responds that it receives a GET request using:

    Just check it again... Yes you forgot a trailing slash... so /user/store will receives only get, while /user/store/ will receive what you form requested.

    Edit

    I inspected what Laravel does, and it solves this particular issue with this addition in their .htaccess (check the original file).

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]
    

提交回复
热议问题