What are the form method Attribute available for submitting?

The method attribute of the HTML <form> tag tells how the form data is sent to the server. There are two values: GET and POST. If you write nothing, the default is GET.

<form method="get" action="search.php">
    <!-- fields -->
</form>

<form method="post" action="login.php">
    <!-- fields -->
</form>
GETPOST
Data goes in the URL (visible)Data goes in the request body (not in the URL)
PHP reads it from $_GETPHP reads it from $_POST
Use for search and filtersUse for login, registration and changes

The details are in difference between GET and POST and PHP Forms Handling.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.