Here is the form that is confusing me
<h1> Login </h1> <form action="" method="post"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr> <td> Username: </td> <td> <input type="text" name="user" maxlength="30"> </td> </tr> <tr> <td> Password: </td> <td> <input type="password" name="pass" maxlength="30"> </td> </tr> <tr> <td colspan="2" align="left"> <input type="checkbox" name="remember"> <font size="2"> Remember me next time </td> </tr> <tr> <td colspan="2" align="right"> <input type="submit" name="sublogin" value="Login"> </td> </tr> <tr> <td colspan="2" align="left"> <a href="register.php">Join</a> </td> </tr> </table> </form>
I got the code from this tutorial and it works fine but i cant seem to understand where a/the form submit too if no action is present
A form without an action attribute is not a form, according to standards - and will actually cause a page reload in some browsers..
The action attribute specifies where to send the form-data when a form is submitted.
By default, the method attribute is set to “get”. This means that your form will send data over an HTTP GET request when it is submitted.
The HTML form action attribute defines where to send the form data when a form is submitted in an HTML document.
If action
is set to ""
or if the action
attribute is missing, the form submits to itself. That is, if your script is index.php
, your form submits to index.php
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With