O'Reilly logo

PHP for Teens by Maneesh Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

HTML Form

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required