Receive Information from a Form


The last step in creating a form is deciding where to put all the information you've gathered. Your choices are the following:

  • Send it in an email to a specified address

  • Store it as a file on your Web

  • Store it in a database on your Web

  • Send it to a form-handling program on your Web server

The first three options require a Web server that supports FrontPage Server Extensions. Form data that is mailed will arrive like any other email. The name and value of each form element will be displayed in the body of the email, as in the following:

 FullName: Puddin N. Tane Title: Mr. THX-1138: Own ROOM-222: Own Purpose: Complaint 

To save a form to a file, you specify the filename and folder where it should be stored. If this file doesn't exist when someone uses the form, it will be created.

graphics/alarmclock_icon.gif

If you don't restrict access to the form results file by using FrontPage's security feature, anyone who visits your Web will be able to read the file by loading its address directly with their browser.


The last way to handle forms is to call up a program on your Web server that can take in form data and do something with it. (Most of these programs simply email the data to a specified address.)

Form-handling programs rely on the Common Gateway Interface (CGI), a protocol that determines how a Web server exchanges information with other programs on the same computer. CGI programs require special access to a Web server, and most Web hosting services don't grant it to their customers for security reasons. Some hosting services install CGI programs that can be shared by all customers.

If you have a CGI program that handles forms, all you need to do in FrontPage is specify the name and location of the program and its delivery method. The method is either POST or GET , and the documentation for the CGI program should specify which one to use.

Figure 40.11 shows how this information is configured in FrontPage.

Figure 40.11. Calling a CGI program to handle a form.

graphics/40fig11.gif

Figure 40.12 shows a Web form that includes every form element described here except pictures.

Figure 40.12. An intrusive Web form.

graphics/40fig12.jpg

Creating this form took the following steps:

  • Text was added to a Web page for use as a label.

  • A form element was added adjacent to the text.

  • The form element was double-clicked and given a name using its Properties dialog box.

An extra step was involved in the creation of the radio buttonsall of these buttons were given the same group name.

After the drop-down menu was placed on the form, items were added to it by double-clicking the menu and using its Properties dialog box.

If the form shown in Figure 40.12 was submitted to an email address, it would arrive looking like the following:

 ************************************************************************* Name:            Rogers Cadenhead StreetAddress:        201 W. 103rd St. City:            Indianapolis StateOrProvince:       IN ZipOrPostalCode:       46290 Age:             30-39 Favorite80sTVShow:      Joanie Loves Chachi LeastFavoriteIceCreamFlavor: Pistachio Tattoo:           What? Tattletale:         ON EmailAddress:        frontpage24@prefect.com MostEmbarrasingThing: I bought two copies of Microsoft Bob and recommended it highly to others. 


Sams Teach Yourself Office Productivity All in One
Sams Teach Yourself Office Productivity All in One (Sams Teach Yourself All in One)
ISBN: 0672325349
EAN: 2147483647
Year: 2003
Pages: 474
Authors: Greg Perry

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net