Forms
Forms are used when requesting data from the user to perform an action. Common forms often found on websites are:
- π a login form
- π§ a sign-in form
- π a password forgot form
- π΅ a checkout form
- π a search/filter form
- π€ a captcha form
There are two HTTP methods commonly used in forms: GET
and POST
. There is a semantic use πΊοΈ: GET
is used by forms "getting" data from the server (search/filter forms), POST
is used by forms creating something server-side (all others forms). In practice, it's up to the developer.
Forms are commonly involving 4 languages:
- HTML: the visual and some constraints (range/required/...)
- CSS: to make nicer forms
- JavaScript: to validate forms/advanced constraints
- PHP: to validate and process forms
The languages involved may change, but there is always a validation that should be done server-side π, such as in PHP, as client-side validations can be bypassed, and they are only used to provide a better experience for normal users.