Part IV: Forms and Databases
|
Chapter 15. Gathering Data with Forms
As you know by now, FrontPage can really help you get your message out to the world. And if you're like most Web authors, you've probably filled your pages with content and formatted them
When you want to gather information from viewers, you'll need to create a Web form : an HTML page that includes interactive fields in which a visitor can type or make a selection. You've probably filled out thousands of forms yourselfto do things like subscribe to the PTA newsletter or access your Web-based email account.
This chapter introduces you to forms and the many ways FrontPage lets you manage them. You can create your own form manually or use a FrontPage form
template
(a ready-made form-creating tool). You'll learn how to collect the data you're receiving in a variety of formatsfrom email to text files, or you can even pipe the
|
15.6. Letting FrontPage Create Your FormAs you've read, creating forms is a lot of work. By now, you might be sorely tempted to find an easier way. Good news: FrontPage can create your form for you. In some cases, as with the Form Page Wizard, getting help from the program doesn't speed up the process much. In other instances, as with the discussion Web site, FrontPage can create a complex automated site for you easily and quickly.
As with most of FrontPage's templates and canned features, using them limits your options for modifying form elements later. Read on to learn about working with the Form Page Wizard. Maybe you're looking for a form to gather feedback, or you'd like
15.6.1. Form Page WizardFor those looking for some help when creating a complex form, FrontPage offers the Form Page Wizard. Remember "wizards" from back in Chapter 10? The FrontPage page-creation tool that prompts you with questions and generates pages from your answers? Same thing goes with the Form Page Wizard. That's all well and good, but honestly, by the time you respond to all the prompts, you could be halfway done creating your form manually with the Forms toolbar or menu. Nonetheless, those who love a good wizard can follow the steps below for creating a form using this tool.
15.6.2. TemplatesFrontPage comes with a few canned form pages that you can use for some commonly used forms, like collecting feedback from visitors to your site or creating a guest book they can leave comments on.
To create a page using any of these form templates, select File
15.6.2.1 Feedback FormThis template creates a Web page with a form on it, designed to collect visitor feedback regarding things like suggestions or problems. Edit this page and configure the form as you would if you created the form from scratch. Results automatically go into a text file, but you can change this if you want. (See Section 15.3.2.4, "Saving Form Results" earlier in this chapter.) 15.6.2.2 Guest BookSelecting this template creates a form page containing one text area field for comments. When a visitor submits this form, results appear on the guest book page. Note: Guest books often
15.6.2.3
|
|
FREQUENTLY ASKED QUESTION
Securing a Subsite |
|
How do I create a subsite that visitors can access only by entering a special user name and password that I give them? The user registration form that you're about to learn how to create lets visitors self-register. This means that they can type whatever they want in the registration form. In exchange for providing information, they get access to your subsite. In contrast, creating a secure subsite one that visitors can only access using the magic user name and password combination that you've approvedis a slightly different process and does not require the use of the user registration form. You can limit access to a subsite by editing your site's permissions.
To create a subsite like this, follow the steps within Phase I only. After step 5, keep your remote site
Within the Administration page, click Manage Users. Click Add a User. Enter the user name and password you want to assign and select a role for the user. (For instance, if you just want visitors to your subsite to be able to browse pages, select Browser.) Click Add User. Repeat for each user you want to add, and then close your browser. |
Phase I: Creating a subsite and setting permissions
To create a subsite and set permissions, do the following:
Create a subsite .
Open your Web site and create the subsite (Section 10.5.5) to which you want to control access. The site you protect must always be a subsite. If you want to force visitors to register to enter your entire site, put it in a subsite. FrontPage needs the root folder of your Web site (the
Publish the subsite .
Before you publish, click Remote Sever Properties on the upper right of the document window, select the Publishing tab, and then turn on the "Include subsites" checkbox. If you don't, FrontPage won't publish your subsite along with the rest of your site. Then publish. (Forgot how to publish? Refer back to Chapter 13.)
Open the subsite on your live Web server .
While still connected to your live Web server, open the subsite in FrontPage. To do so, click the "Open your remote Web site in FrontPage" link within Remote Web site view (see Section 13.3.2 for details) and double-click the subsite's folder. The subsite opens in a new instance of FrontPage.
Set permissions for the subsite .
With the subsite open, select Tools
Server
Permissions. You may be prompted for the administrative user name and password that your Web host or IT administrator gave you. Then the Permissions Administration Web page appears (see Figure 15-17). Click Change Permissions. Within the Change Subweb Permissions page, click Use Unique Permissions. Then click Submit.
|
Turn off anonymous access for the subsite .
All FrontPage sites automatically allow
You can close the site and end the connection to your remote Web server, if necessary.
Phase II: Creating the user registration form
To create the user registration form, do the following:
Open the subsite in FrontPage .
Create the registration form .
Open the subsite and select File
New. Within the New task pane, click "More page templates." Then, within the Page Templates dialog box, double-click the User Registration template. The form opens in the document window.
Replace and replace the text "name of your sub site with the actual name of your subsite. (Refer back to Section 12.1.3 for help with replacing text.)
Configure registration form properties .
Right-click the form (
Click Options, and set the following properties on the Registration tab:
Web site name . Type a slash (/) followed by the name of your subsite folder.
User name fields . Type in what you'd like to call your user name field. If you're creating more than one user name field (splitting first and last name, for example), type in all field names separated by commas.
Password field . Enter the name of your password field. "Password" always works quite well.
Password confirmation field . It's always a good idea to make visitors type in a password twice, to make sure they haven't made errors. Type in the name of the password confirmation field.
Require password
. Leave this checkbox turned on to force the visitor to enter a password longer than six
URL of registration failure page . FrontPage creates a failure page automatically, so you can ignore this field. However, if you want to create a custom failure page, do so and enter its URL here.
Click OK, and FrontPage warns you that your new registration form must be saved in the "root Web." Click OK.
Save the form page in the root Web site (parent folder to the subsite) .
User registration forms must live in the
root Web site
. A site's root directory is the core folder where the
index.htm
or
default.htm
page lives. For example, when a visitor types in
http://yoursite.net
, the file he sees lives in your site's root folder. The
Publish your root Web site .
Test your registration form on the live Web server .
If you want to create a discussion site, in which people can post and reply to messages, FrontPage offers you a wizard that walks you through the process. To do so:
Open the site in which you'll place the discussion site .
A discussion site should be a subsite within an existing Web site. You can create the subsite and discussion component together, if you skip ahead to step 2. If you've already created the subsite that'll hold your discussion, open it in FrontPage.
Launch the Discussion Wizard .
Select File
New, and in the New task pane, click "More Web site templates." If youre creating a discussion within an existing Web site, turn on the "Add to current Web site" checkbox and double-click the Discussion Web Site Wizard. If you're creating a new subsite to hold your discussion, add the new folder name at the end of your site's directory path, which appears in the "Specify location" field.
Select all the
To create a user-friendly discussion site, keep all these checkboxes turned on:
Submission form is mandatory, because this is the page visitors will use to enter their messages.
Table of Contents provides an index page with a table of contents, which includes links to each message visitors post.
Search Form lets visitors search all messages for special text.
Threaded Replies
groups messages together with
Confirmation Page lets visitors receive a confirmation page after they've posted a message.
Name the site and folder .
Name the discussion site (as usual, don't include capital letters, spaces, or special characters, and keep it short). Name the discussion folder. You can keep the name FrontPage has automatically entered here or type your own, but it must begin with an
Select form input fields .
Choose one of the three options FrontPage
|
Tell FrontPage whether or not you're going to set permissions on your discussion site and then click Next .
See Section 15.6.2.1 to learn how to restrict access to a subsite.
Select the order in which you want to display messages and then click Next .
Tell FrontPage whether you want the Table of Contents page to be the home page for your site .
If you're creating your discussion within a new site or a subsite, you should click Yes.
If you're creating your discussion in an existing site, clicking Yes overwrites your index.htm file, which is probably not what you want, so click No.
Configure search form results .
If you elected to have a search form in your discussion site, FrontPage asks you what information you want visitors to see. Make a selection and then click Next.
Select a frame option .
If you want to display the discussion using frames (Chapter 6), click some of the choices here, and FrontPage previews the layout on the left. Using frames lets visitors see the table of contents and messages
Create the discussion Web site .
Click Finish on the last dialog box (which contains no choices).
FrontPage adds a bunch of files to your site. These file names begin with the name you gave your discussion in step 4. For example, say you created a discussion for growers to share information on kiwi fruit. If you named your discussion "kiwi," you'd find pages named:
kiwi_toc.htm (table of contents). If your discussion is part of another site, link to this page to bring visitors to the discussion. This page has all the links visitors need to search and post.
kiwi_post.htm . The page containing the form visitors fill out to post a message. If you elect to include a Category or Product list when you create the discussion site, open this page to access those form fields. Double-click on the form field to add selections to the drop-down list.
kiwi_cfrm.htm . The confirmation page visitors receive when they add posts.
kiwi_search.htm . This lets visitors search messages within the discussion.