CGI and Perl

Other Pages to Complete Your Site

To complete your MiniVend site, you should create a few other pages. To display the order confirmation to the user, you can use confirmation.html. Nothing about this page is complicated. You may want to use [page] link tags to allow the customer to navigate back into your store to buy more. Another useful page is notfound.html. This page is shown when vlink is unable to locate a certain page. This page is useful as a catch-all so that customers aren't subjected to any nasty default error pages. Another page you may want to create is flypage.html. This page enables you to display a complete description of a particular item. A page is constructed on the fly using information in your product database.

You also should create a few pages such as badsearch.html and nomatch.html to catch certain conditions. badsearch.html handles cases in which invalid search data is passed into the search engine. nomatch.html handles conditions in which no items are found with the given search criteria. You might also want to create special pages. For example, you might be having a close-out sale. You can then link to these pages by using the [page] tag.

Frames

Using MiniVend, you also can use frames for your shopping site. Some special minivend.cfg variables such as FrameOrderPage and FrameSearchPage enable you to specify special pages for use with frames. Frames are given names for specifying the TARGET value of an <A HREF> tag. There are also the special frame names _top, _blank, _parent, and _self. To tell MiniVend that frames are in use, you should use the [frames_on] tag in the first page that the customer accesses to enter the store. The [framebase] tag sets the base target for a page.

Some demo pages that enable the use of frames are contained within the MiniVend package. If you're interested in this feature, I encourage you to take a look at the sample shopping site.

Additional Tools for Administration of Your Site

Also included with MiniVend are a few tools for the administration of your shopping cart site, which you learned about earlier. In the following sections, I describe two of the tools that might make your life easier as the caretaker of your online store. vendpage One of the administrative tools available for you to use is the vendpage program. This tool takes existing HTML files and converts them to MiniVend pages, redefining links in the format used by MiniVend. It follows a few simple rules:

  1. Any link that starts at the root or with a protocol specification is left as is.
  2. All relative links are changed relative to the PageDir directory specified in the configuration file.
  3. Links to names in the same document remain unchanged.
  4. Image specifications that are relative are changed such that they must be placed in the images directory relative to the HTTP servers DocumentRoot.
  5. Comments that begin and end with [vend] and [/vend] are stripped and passed on as vend tags.

For more information on this tool, refer to the vendpage documentation, which is contained in the MiniVend package. mat Another useful tool is the mat program, as shown in Figure 13.8. It enables you to modify the current configuration remotely through a standard Web interface. With this tool, a user from any platform (that has a Web browser available) can start the MiniVend server, view error logs, and even modify the configuration settings. You will obviously want to put this tool into a protected CGI executable directory so that ordinary users cannot modify your store. Refer to Chapter 3 for more information on how to create a protected directory.

Figure 13.8. The mat remote administration tool from within the browser.