html codes, html tags, html tutorial,html colors html color codes, Introduction to HTML, HTML Wikipedia, Free tutorials on HTML,HTML Help, HTML An Interactive Tutorial,HTML Code Guide, Learn HTML, Learn HTML Free, Free HTML tutorial, Use our HTML tutorial to help learn HTML code tags. This HTML code tutorial and HTML guide is easy, interactive, and guided by example, HTML Introduction,Getting Started,HTML Elements, HTML Comments,Headings,Paragraph,Lines/line-breaks Links,Images,Attributes,Formatting Tags,Align Lists,HTML Tables,Cellspacing and Cellpadding, Colspan and Rowspan,Height and Width,HTML Frames, HTML Forms,Textbox,Textarea,Radio Button,Checkboxes, Drop-down List,Submit/Reset Buttons,GET and POST METHODS.

HTML Get & post methods

In HTML, we can specify two different methods (GET and POST) for a form submission. The method is specified in form element, using the method attribute.

syntax

<form action="destination" method="type">

In the above syntax "type" can be GET or POST. The information is sent to the page specified in the action attribute.

The difference between GET and POST is primarily defined in terms of form data encoding.

Note: The default method is GET.

POST method Example

<html>

<form action="" method="POST">

Name: <input type="text" name="name" /><br />
Email: <input type="text" name="email" /><br />

<input type="submit" value="Submit" />
<input type="reset" value="Reset" />

</form>

</html>

Output

Name:
Email:

Enter information in the fields and click Submit button, your information will not be displayed in the URL.

Get method Example

<html>

<form action="" method="GET">

Name: <input type="text" name="name" /><br />
Email:<input type="text" name="email" /><br />

<input type="submit" value="Submit" />
<input type="reset" value="Reset" />

</form>

</html>

Output

Name:
Email:

Enter information in the fields and click Submit button, your information will be displayed in the URL.

Note: GET is usually used for just getting/retrieving data whereas POST is used for getting/retrieving, storing/updating data, ordering a product, or sending E-mail etc.