catcode.com > Guide to HTML Forms > The <form> HTML element

The <form> HTML element

Before you can start building the back of the subscription card, you have to look at the front side. First, you need to specify the address to which you're sending the information. We do this with the <form> element, whose model is shown below:

<form action="script" method=["get"|"post"]>
  <!-- form contents go here -->
</form>
front of subscription card

The action= attribute specifies a script, which is the “destination address.” It's the name of a program on the server that will handle the information you're sending. This script is usually written in some programming language like Java or Perl. We'll leave that task to some programmer.

The method= attribute tells how you want your message sent. Sometimes your webmaster or programmer will tell you that you must use "get" or "post". In the absence of any explicit instructions, we recommend that you use method="post". If you're really interested in knowing the difference, here's a fairly lengthy explanation.

And here's a specific example of a <form> tag. It will send the data (once we get it all organized) to a script named subscribe.cgi via the post method:

<form action="subscribe.cgi" method="post">
  <!-- form contents go here -->
</form>