How does POST action work on a drupal login form? I was looking at the login form tag of Drupal and was surprised that it does not reference any specific page to handle login. Example:

&lt;form action="/node?destination=node" .....&gt;


Or if I go to the login page directly:

&lt;form action="/user/login" .....&gt;


or

&lt;form action="/user" .....&gt;


So how does this work? How does the browser know which page to submit the POST data to?
Drupal uses the Form API to handle this. It doesn't need a specific page to handle the POST data because of the way its structured. Also see user_login to get an idea of how it's implemented. You can see that it sets specific validation functions to be called when the form is submitted, and then it moves on to user_login_submit (this part happens due to the default naming conventions of the Form API). There's other magic in there that makes this all work, but it usually isn't necessary to understand it in order to develop with Drupal.