Now that you have seen the HTML template, let’s build an HTML form. Forms communicate data to PHP. Use the <form></form> tag to create a form. (Crazy, huh?) This tag surrounds all of the inputs, such as textboxes and submit buttons.
The actual <form> tag itself has several attributes, which are tag describers. Put attributes into an HTML tag like the following:
<tagname attribute1="value1" attribute2="value2">
The important <form></form> attributes follow:
method describes the way the data is transferred. I talk more about these methods in the next chapter.
action explains where the data is being sent. Generally, the data is sent to a separate PHP file, which operates on the data.
Let’s define a form, leaving the action blank and setting ...