I’m working with some HTML forms and I just want to know if it is okay to use a URL parameters in the action attribute even if the method attribute is POST?
<form action="index.php?somefield=someval" method="post">
<input name="anotherfield" value="anothervalue" type="text" />
<input type="submit" />
</form>
Well, this works fine, I can get all fields and their values in my postback page but I want to know if I’m breaking some rules, standard or something by doing this? Please, if you can, show some resource that can prove it is okay because I can’t find it in W3.org.
As the specifications RFC1866 section 8.2.3 states that:
When sending a
POSTrequest, the form data is actually sent in the body of the request, not in the header. So the request URL (the form’saction) is different from the request body.The data sent to the server in the background looks like this: