You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not possible to send a POST request to the root of your application if your application is in a subdirectory (localhost/app/ for example) with a form generated by form_open.
The form action is /localhost/app which redirects to /localhost/app/ so the POST variables are lost...
I solved this temporarily to manually set the url for the form with a trailing slash, but this shouldn't be the way I guess...
This is the code I have used in my page function onStart(){ $this['url'] = Request::url() ."/"; }
This is actually caused by your webserver adding the trailing slash because the public path is treated as a directory. This only occurs when the website exists in a subdirectory.
The solution used by @RoySchoep is the best workaround.
It is not possible to send a POST request to the root of your application if your application is in a subdirectory (
localhost/app/
for example) with a form generated byform_open
.The form action is
/localhost/app
which redirects to/localhost/app/
so the POST variables are lost...I solved this temporarily to manually set the url for the form with a trailing slash, but this shouldn't be the way I guess...
This is the code I have used in my page
function onStart(){ $this['url'] = Request::url() ."/"; }
In my HTML/TWIG
{{ form_open({ 'files': 'true', 'url': url}) }} {{ form_close}}
The text was updated successfully, but these errors were encountered: