Using Form TagsTo start out, you want to set up your <FORM> environment to build a form within a Web page. It's okay to add a form to an existing HTML document or build a separate one just to contain your form. I recommend that you add shorter forms, half a screen or less, to an existing document. Create a new file if your form is larger than half a screen. Setting the <FORM> EnvironmentThe two key attributes within the <FORM> tag
are METHOD and ACTION. Together, these attributes control how information is sent to the
Web server and which input-handling program receives the form's content. There's no rhythm to MethodThe METHOD indicates how the information is sent to the server when the form is submitted. METHOD can take one of two possible values: POST or GET. Of these two methods, I prefer POST because it causes a form's contents to be passed one element at a time. GET, on the other hand, joins all the field names and their associated values into one long string. Because UNIX systems have a limit on how long a single string can be (255 characters), it's not hard to imagine that some of the information might get lost when it's contents are condensed. Lights, camera...ACTIONACTION supplies the URL for the CGI script or other input-handling program on the server that receives a form's input. The URL can be a full specification (absolute) or simply a relative reference. Either way, you need to make sure the URL points at the right program, in the right location, to do the job that's expected. Let's make an assumption...Because GeoCities has provided the input handling program for us, we don't have to worry about writing such an advanced program ourselves. So, we will follow two conventions for all the syntax in this lesson.
|