Suppose we want to create a basic login form:
We'll need three parts to this form:
To create this form, we'll start with the <form> and </form> tags. Together, they create a container that marks the beginning and end of the form. All the elements of the form will appear between these two tags.
<form> </form>
The form tags, by themselves, have no visible effect on a Web page except for a blank line they create above and below the form. Because a form is invisible on a Web page, it's easy to forget to add the closing </form> tag, or to put multiple sets of <form> and </form> tags where you really only need one. Check for these errors first if you're ever having trouble with a form you've created.
Now, the <form> tag needs several attributes. Let's go through them:
Using get is the equivalent of scribbling a quick note on a scrap of paper and handing it off to a friend. Using post is like sitting down to write that friend a formal letter, sealing it in an envelope, and dropping it in the mail. If you're not sure which method you should be using, you may want to [hire a programmer] to write your forms for you.
Since our form is a login form, we'll want to keep the information secure and use post as our method. The HTML code for our form thus far should look like this:
<form action="http://mysite.com/scripts/login.php" method="post"> </form>