post requests not getting through

32 views
Skip to first unread message

v.

unread,
Jan 17, 2018, 3:01:01 PM1/17/18
to Fat-Free Framework
hi,
I am trying to get an application I wrote (and which works fine on another server) to work in my old NAS.
I am trying to figure out why my post requests are not working as they should.
My forms all have:
<form action="{{ @BASE }}" method="post" class="form-horizontal">
which seems to be working just fine on my hosting company's server.
When I use this on my NAS the form does not get posted as a POST request.
Changing the action to empty (action="") does work.
I assume this is because the form gets posted to it's own page, so it is a routing issue?
However, when I do the same thing on the index page of the website (which corresponds to the @BASE if I understand correctly), the same thing happens: the form is not posted, I can only get the $_GET parameters.
What could be causing this? What is the proper way to post the form?

My NAS has php 5.6, while the webserver on my hosting account has php7.0.



ved

unread,
Jan 17, 2018, 3:59:41 PM1/17/18
to Fat-Free Framework
What does @BASE resolve into on each server?

Are the fields always posted when leaving the action empty?

Why even use @BASE on form actions and not just leave all action's empty when posting to the same page ?

v.

unread,
Jan 18, 2018, 3:30:38 AM1/18/18
to f3-fra...@googlegroups.com
Hi,
@BASE points to the root page of the site.
html5 specifies that action can not be empty:
https://dev.w3.org/html5/spec-preview/form-submission.html:
The action and formaction content attributes, if specified, must have a value that is a valid non-empty URL potentially surrounded by spaces.
I only now understand that you can possibly just leave the action out all together.

richgoldmd

unread,
Jan 18, 2018, 3:40:44 PM1/18/18
to Fat-Free Framework
If you're posting to the same page that generated the form you can omit the action attribute.
Also, make sure the route includes POST as an acceptable method. 
If you use action="{{@BASE}}" you going to get the post at the / route, but if your app is not in a subfolder, @BASE may be empty, in which case your action="" may be invalid HTML5
Reply all
Reply to author
Forward
0 new messages