What are forms
Forms are user inputs that can be stored using the form tag and are often used for inputs such as username and passwords.
What do they do
The form tags can be used to store informations in to php file and can be used to call back other information, such as when you input a certain word in to a submit file, it will return something based on your input.
How to use them
A form can be created using "form" and "/form" tags(replace " with < and >), when you write a form, it have a few parts in it, as shown in the example below:
<?php echo ' <form action="test.php" method="get"> Name: <input type="text" name="name"> <input type="submit"> </form>'; if (isset($_GET["name"])) { echo $_GET["name"]; } ?>As you can tell, this is a php code, and the form tag contain action and method:
Different kind of forms
There are many types of forms especially in HTML, and they are shown using
< input type = "type of input here" name = "description"> where input type changes what the information in putted will
look like and name serve as a description of how the form will be used for. The type of forms are: textfield, password,
radio buttons, check boxes, and submit buttons. Most of them are self explanatory, radio buttons are like this:
Just having the option isn't enough, in order to actually use it, you must call the information and
command the computer to read the code in a specific way using "echo" command in php.
PHP and HTML form work together and are very similar
As shown above, PHP and HTML forms are very similar, but they use the form tag differently. While HTML file only use the form tag to show where it is, PHP actually specify what the form calls and the way the information is transferred.