+ 4
What is the purpose of form methods in HTML?
That "POST" and "GET" thing (+"PUT" +"DELETE" I guess), I don't understand
5 Respostas
+ 8
HTML <form> method Attribute
❮ HTML <form> tag
Example
Submit a form using the "get" method:
<form action="demo_form.asp"method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>
Definition and Usage
The method attribute specifies how to send form-data (the form-data is sent to the page specified in the action attribute).
The form-data can be sent as URL variables (with method="get") or as HTTP post transaction (with method="post").
Notes on GET:
Appends form-data into the URL in name/value pairsThe length of a URL is limited (about 3000 characters)Never use GET to send sensitive data! (will be visible in the URL)Useful for form submissions where a user want to bookmark the resultGET is better for non-secure data, like query strings in Google
Notes on POST:
Appends form-data inside the body of the HTTP request (data is not shown is in URL)Has no size limitationsForm submissions with POST cannot be bookmarked
+ 3
that is the most important difference. Post is used server side mostly, while Gets are use for searchs.
You don't want to show a password in you url (or credit cards data), so you use post.
+ 2
to send information between each html.
if you have a searchbox in your index.html page, then you will need the value of that text in your catalog.html.
+ 1
could you give some examples of each one?
+ 1
So basicly the difference is the way that the input given is shown on the directory?
I'm getting it, but it still unclear