Chapter One
The World Wide Web makes it easy to publish electronic documents with a vast potential audience. Millions of people are already online, and the number is growing at an astounding rate. Many more are using the same Web technology through internal networks in businesses, often called intranets, in contrast to the Internet.
Being able to reach this huge potential audience is powerful and exciting. Even more exciting, you can actually interact with them. They can respond to your Web site with feedback, comments, ideas, or requests for more information. Such interaction is typically accomplished using Web forms. Any Web document into which someone can type new information is a Web form, or simply, a form.
Forms are used for all sorts of things: electronic guest books, requests for information, online ordering, applications, and information gathering. You use forms to get whatever information you want from people who visit your Web site.
The problem with forms is that you must typically write a new computer program for each form that you use in your web. PolyForm solves this problem by providing an effortless interface for creating forms and managing interactive Web applications.
This book is dedicated to helping you incorporate forms into your web. Creating the form (and getting people to fill it in!) is only part of the picture. What do you do with the information gathered from a form? How do you respond to the person who took the time to complete the form?
Most of your Web documents publish information for others to read. Forms make the Web a two-way street, allowing people to send you information. PolyForm makes it easy to gather and use this information. Let's look at a few ways PolyForm can be used in Web sites.
At first she just put a little information about her business on a local commercial Web site. She registered her site with all the Web indexes so that anyone searching for Stone Crabs would find her business.
As you may know, Stone Crabs are considered a delicacy by many folks, and some people are positively obsessed-Marcia received a lot of email. She decided to make her Web site as friendly as possible by putting her picture in the welcome document. Then she got her own Web server, and PolyForm; she added a guestbook and a comment form. The Stone Crab harvest is seasonal, so Marcia created a form to collect email and street addresses from potential and actual customers. In return, she sends out a quarterly Stone Crab newsletter by email.
Her most recent innovation was to hold an electronic drawing for prizes. She sent email to everyone in her database to tell them to register, and she created a form to collect information from the registrations. She was rewarded with a lot of extra business and publicity because of the contest, and several lucky winners did not go hungry.
In the near future Marcia plans to buy a secure Web server that will make it much safer to take credit card orders over the Web.
They soon started to use PolyForm to let people request brochures and even make reservations online. Business has never been better. They even have a new business. The local Chamber of Commerce pays to put information on other area businesses online, and the local newspaper also publishes a Web edition on Ben and Sarah's server. Ben and Sarah create all the forms for their customers, and use PolyForm to handle the information people submit.
Not having a lot of time to devote to learning HTML and CGI programming, Dieter picked up a copy of PolyForm to make it easy to get started.
After playing around with PolyForm, the first change he made to his web site was to convert his long list of "hotlinks" to a series of Select Lists. Now users see list boxes for several of his interests. When users select an item on one of the lists and click on a "Go" button, PolyForm sends them to the document they selected.
Then he added a comment form. He created the script to have PolyForm send the comments to him by email.
To do something a little more involved, and because of his literary inclination, Dieter created a branch of his web in which people can add to an ongoing story. The first document describes the story, and how people should add to it. The second document is the progressing story, and includes a form at the bottom to allow people to enter new text. Each new addition is inserted after the previously written text, but before the form. The form runs a script that adds text to the document containing the form.
After another series of meetings Allison became the project leader on a project to put several internal procedures manuals online. Rather than print hundreds of copies, from now on people would read the electronic version, which would always be up-todate.
Although she had no budget to hire a programmer, she was able to use PolyForm to create an online timesheet to save data in a format that works with the department's existing software. Many people now use an HTML form to submit their timesheets. The administrative assistant who previously spent a whole day typing timesheet information into a database is very grateful.
Just for fun, Allison created the sign-up sheet for the department softball team as an HTML form; a few people complained, a few thought it was cute, and the people who don't like softball didn't notice the difference.
You have surely filled out thousands of forms in your life-on paper. You are well aware that nothing happens until someone processes the form. Then you get your mortgage, your passport, your tax refund, or whatever.
When you use the HyperText Markup Language (HTML) to create a form, you can make it available to anyone on the World Wide Web, or your intranet. When someone fills in your form, it is PolyForm's job to process the information the way you choose.
If you are new to working with forms, you will need to know the difference between the way normal Web documents are delivered, and the way information from forms is processed. For regular Web documents, you create the document and place it on a Web server. When a user asks for that document by clicking on a link, or typing the URL (address) in a Web browser, the server finds the document and sends it to the user's browser, as shown in Figure 1-1.
Figure 1-1 Delivering a Web document
Forms require an extra step. You must process the information from the form. This is part of what PolyForm does. Without PolyForm you would typically need to create a new computer program for each form that you process.
The general process works like this: You create an HTML document with tags for a form. The user requests the form document by clicking on a link or entering a URL in a Web browser. The server returns the document and the browser displays it-just as for any other HTML document. Then the user fills in the form, and clicks on a submit button. The browser sends the information to the server, which passes it along to the forms processing program. This program is a Common Gateway Interface (CGI) program. The program processes the information, then sends another document back to the browser.
Figure 1-2 shows the additional steps in forms processing.
Figure 1-2 CGI process
Thankfully, you don't have to create a CGI program to process your forms; one component of PolyForm is the CGI program.
PolyForm makes it easy to process information submitted via forms. You use the PolyForm Control Panel to create instructions-called a script-about what to do with information submitted via a form. Scripts are very easy to create. You can use the Script Wizard to create a script and form in less than a minute!
When someone submits a form, the PolyForm CGI program runs, processing the form contents according to the instructions in your script. Because the form, the script, and sometimes other files all work together, we often refer to the whole set as an application. (See Figure 3-1.)
Your script tells PolyForm what you want to do with the form contents and what kind of response you want to send back to the person who submitted the form. PolyForm is ideal for businesses that need to interact with Web customers, for online publications and newsletters asking for reader input, for companies collecting timesheets or departmental reports through an internal web, for workgroups collaborating on an intranet-for all those who want to open up their Web servers for two-way communications with their users. With PolyForm, your visitors can answer surveys, order products, provide feedback, request information, and sign guest books.
PolyForm's graphical interface and intuitive design give Web users with all levels of experience the power to develop and manage inviting Web forms. Beginners will have effective forms up and running in minutes with the easy-to-use Script Wizard. Advanced users can concentrate on HTML formatting for more elaborate form design, and save hours while PolyForm automatically performs all of the associated CGI programming.
Figure 1-3 A sample PolyForm application
PolyForm is a powerful solution for building and managing interactive Web pages with forms that collect, process, and respond to each user's specific input. Use PolyForm's interactive forms to let users react to what you publish on your web with their own feedback, ideas, or requests for more information. Forms that once required hours of complicated programming can be created in minutes using PolyForm.