Forms are widely used so people visiting a page can send information to someone by simply answering a few
questions. Whether it's to recieve information from the user, or to be able to access certian parts of your pages, forms can be invaluable.
First we'll start with the basic forms tags. They are <form> </form>.
Pretty, easy, huh? Now tell the form what to do.
There are two different methods: POST and GET. GET is used to retrieve information from the site. For example:
<form method=GET action="index.html">
<input type="submit" value="Click Here To Reload This Page">
</form> would result in
POST will work for almost everything
you would ever need. The action is what tells the form what to do. If you wanted the form to be mailed to someone, you could use the first example. But you may not like what you get back. Usually, it looks like this:
name+john&+henry&+address+p+o+box&...
Obviously, this is hard to read. So you can try adding
ENCTYPE="TEXT/PLAIN" to the
tag to take it away if you have
a newer browser. The best way to accomplish this is to use CGI Scripts
to filter out the garbage and mail you the response.
After the first form tag, you can have any of the following...
Now that you know the commands, let's see one in action. You can also view the code for the form by viewing the source here. Well, here it goes. Please fill in the following:
Hopefully, this answers any questions you may have about forms. Except, how do you make it with all the nice output? When I do it, I get a bunch of crap. What am I doing wrong?
The answer is: nothing. It's not your fault. That's just the way the mail program sees it. If you would like the nice output like mine, travel on to the CGI section of this site, or ask your local sysadmin where they store
theirs and if you can access it.