array $ _POST always empty |
07-11-2022, 12:33 PM
(This post was last modified: 07-13-2022, 02:44 PM by includebeer. Edit Reason: link to image was not working )
Good evening everyone,
i am new to codeigniter 4, i used 3. I'm making a simple form with method = post which refers to a controller; I followed the tutorial on the guide of ci4 "build your first app" however the array I get $ _POST is always empty. i think there is an htaccess rule that adds a trailing slash, doing so I lose the array. Has it already happened to anyone? Thanks a lot to those who will help me sorry my english https://drive.google.com/file/d/14xmLu4f...sp=sharing
Your rule redirects the POST request, and you will see the next GET request. So $_POST is empty, because it is a GET request.
Yes, there is a slash rule in .htaccess. Only it does not add, but removes the slash. You can even see it in your screenshot.
Three solutions. 1. Remove slash from url (recommended) 2. Remove forward slash rule 3. Change the response code in the slash redirect rule from 301 to 308 (or 307). |
Welcome Guest, Not a member yet? Register Sign In |