home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Using the Hit Counter Component

One popular element on the home page of many sites is a counter that indicates how many people have visited the page. When counters first started to appear on pages, they were simply text, but later Web content providers got fancy and sent images to the browser to represent the digits in the visitor count. This enabled counters to take on various looks—some looked like a car odometer and others looked like an LED readout. Either way, counters add a little pizzazz to a page and give the page’s owner a sense of how popular the page is with Web surfers.

It used to be that you had to code a CGI script to retrieve the previous count, add one to it, and then display the result. Further coding was needed if you were going to parse the visitor count and send each digit as an image. But now, FrontPage relieves you of all that by providing a Hit Counter Component that you drop into place on a page.

To put a Hit Counter Component on one of your pages, follow these steps:

1.  Choose Insert, FrontPage Component, or click the Insert FrontPage Component toolbar button to call up the list of available components.
2.  Select Hit Counter and click OK to call up the Hit Counter Properties dialog box shown in Figure 10.12. FrontPage enables you to choose from five counter digit styles, or you can specify your own custom style. Additionally, you can reset the counter to a desired value, and you can restrict the counter to be a set number of digits.


FIGURE 10.12  Before FrontPage, hit counters required extensive server-side programming.


CAUTION:  

If you restrict the number of digits in your counter, make sure you leave enough digits to accommodate the traffic on your site.


When the Hit Counter appears on the Normal tab of the FrontPage Editor, you’ll see the text “[Hit Counter]” rendered in boldface. If you switch to the HTML tab, you’ll see code such as the following:

<!--webbot bot=“HitCounter” i-image=“1” i-digits=“7”
b-reset=“FALSE” PREVIEW=“&lt;strong&gt;[Hit Counter]&lt;/strong&gt;”
u-custom i-resetvalue=“0” -->

Using the Substitution Component

The Substitution Component inserts the value of a Web or page configuration variable into a document. The default configuration variables available to the Substitution Component are:

  Author
  Modified By
  Description
  Page URL

Any Web setting parameters you specify in the FrontPage Explorer will be available to the Substitution Component as well (choose Tools, Web Settings; see Figure 10.13).


FIGURE 10.13  You can establish global Web parameters that are available for placement on a page using the Substitution Component.

To use the Substitution Component, follow these steps:

1.  Choose Insert, FrontPage Component, or click the Insert FrontPage Component toolbar button to reveal the dialog box that lists the components.
2.  Select the Substitution option and click OK to open the Substitution Component Properties dialog box you see in Figure 10.14.
3.  Choose the configuration variable you want from the drop-down list and click OK to place the component.


FIGURE 10.14  The Modified By variable is a useful substitution for Webmasters who track changes to documents on their sites.

When the Substitution Component appears on the FrontPage Editor’s Normal tab, you’ll see the name of the variable you selected enclosed in square brackets. On the HTML tab, the Substitution Component is represented by code that resembles the following:

<!--webbot bot=“Substitution” S-Variable=“vti_modifiedby” -->

Using the Confirmation Field Component

Forms are a Web content provider’s means of collecting information from end users. Data entered into a form is typically sent back to the server for some kind of processing, but before that happens, you can do a few things with the form data to ensure that it is as polished as it can be. One thing is to confirm the data in the form’s key fields, and the FrontPage Confirmation Field Component can help you do it.

The first thing you need to make a form field confirmation is, not surprisingly, a form. Assuming you’ve already used the FrontPage Editor to compose a form, go back through the form and write down the names (as assigned in the NAME attributes) of the form fields you want to confirm. You’ll need the field names when inserting the Field Confirmation Components.

Next, you need to create a confirmation page where the Field Confirmation Components will reside. To do this, follow these steps:

1.  In the FrontPage Editor, choose File, New and then select the Normal Page option.
2.  Put whatever banner, background, and text you want on the page, leaving spaces for where you want the form field confirmations to go.
3.  Place your cursor at a position where you want a confirmation, and then choose Insert, FrontPage Component, or click the Insert FrontPage Component toolbar button. From the Components list, select the Confirmation Field option.
4.  Enter the name of the form field you want confirmed in the Confirmation Field Properties dialog box (see Figure 10.15) and click OK.
5.  Repeat steps 3 and 4 for each field you want to confirm.
6.  Save the confirmation page to your open Web.


FIGURE 10.15  Confirming the data submitted in a form field is as simple as typing the field’s name into a dialog box.

With the confirmation page created, the last thing you need to do is to link the form with the confirmation page. You can accomplish this by performing these steps:

1.  Open the form page in the FrontPage Editor, right-click the form, and select the Form Properties option.
2.  Click the Options button in the Form Properties dialog box.
3.  In the Options for Saving Results of Form dialog box, click the Confirmation Page tab. You should see the dialog box shown in Figure 10.16.


FIGURE 10.16  You need to tell FrontPage if a form has an associated confirmation page.

4.  Enter the URL of the confirmation page or browse to the page itself if it’s in your open Web.
5.  Click OK in the Options for Saving Results of Form and Form Properties dialog boxes.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.