Tutorial for Method Attribute in html for php

What is Method Attribute?

The HTTP method used to transfer data while submitting the form is specified using the HTML form> method Attribute. The HTTP methods GET and POST are the two types of HTTP methods. With the form> element, the method attribute can be used.

Html 4

Attribute Values:

  • GET:- When using the GET method, the form data are shown in the address bar of the new browser tab once the form is submitted. It is restricted to around 3000 characters in length. It’s just good for non-sensitive data, not for sensitive data.
  • POST:– After submitting a form with the post method, the form values will not appear in the address bar of the new browser tab, as they did with the GET method. The form data is appended to the body of the HTTP request. It is unrestricted in terms of size. The outcome of this technique is not bookmarkable.

Which are the Supported Tags:

<form>

Syntax:

<form method="get|post">

Example 1:– This example illustrates the use of GET method attribute.

Output:-

Example 2: This example illustrates the use of the POST method attribute. This method sends the form-data as an HTTP post-transaction. 

Output:-

Tagged : / / / / / / / / /