Previous Page TOC Next Page



– 13 –


Databases and Searches


Computers make it possible for you to organize huge amounts of data and recall that data quickly. When information is contained within databases, you can easily search, update, change, generate specialized reports, and in general push, prod, or pull information from the system in any way you desire.

When you give WWW viewers the ability to search your databases, you are giving them a wealth of information.

You can easily separate the issue of databases and the Web into two distinct categories: from your database and onto the Web (presenting information contained within a database on the Web, a very complex project) and from the Web and onto your database (importing data from forms into a database, which is not so complex).

From Your Database and onto the Web


The use of databases with the Web is a new and complex issue; things seem to be changing on a daily basis in terms of the products available and the uses for those products.

A few uses for databases on the Web:


Putting Your Product Information Online


When putting your product information online, you need to consider two points. First, your customers should be able to easily browse through or search for a product (and to have the product information up-to-date); and second, they need to be able to order that product online simply. (Payment issues are discussed in Chapter 16, "Taking Payment Online.")

The most challenging part will be keeping your information up-to-date. You could easily put your catalog online in HTML format within an easy-to-navigate Web site and accomplish this if you have a small inventory (see "Keeping It Simple," later in this chapter), but if you provide tons of different products or if your product information (such as pricing) changes often, keeping all this information up-to-date can soon turn into a time-consuming job. The solution? Providing this information in a database! Hopefully, you are already using a database for keeping this information up-to-date, and if so, the solution is simply (or not so simply) a matter of connecting that database to the Web. This keeps the information all in one place, while allowing different ways to access and view it.

So, how do you hook up your database to the Web? Well, you'll need a program that queries the database and returns an HTML-formatted result. This is called a dynamic site. It offers ease of maintenance and administration for a large database system, and even enables dynamic, data-driven Web sites that use HTML documents which are generated on the fly (from information stored in databases and provided by users). Page content can be instantly customized based on user requests.

All this requires either a lot of programming skill, or time learning a new commercial program designed for this purpose. It also requires that your information be in a certain database format or that you transpose all your product information into an acceptable format (what that acceptable format is depends on the program used to access it). This also requires certain things from your server that you may or may not have available. In most cases, you will need your own server in order to do this.

The programming involved in setting up and connecting a database to the Web is far too complex a subject to describe here, but we would like to give you a quick overview of some of the commercially available products for this purpose:


Cold Fusion Professional 1.5

This is a self-contained Web database tool; about the only other things you need to put your database on the Web are your database and server. It can be used to create a wide variety of applications that integrate relational databases with the Web on the Internet (or on Intranets).

Source: Allaire Corp.(http://www.allaire.com/); free demo available.

Databases supported:

Platforms supported:

System Requirements:

Web Servers Supported:

If you are using one of these products, you can be assured that your server is fully supported. If, however, you are using another product, your server may still be supported. Your best bet is to check the support area of the Allaire Web site for information on your particular server.

Overview

Cold Fusion is a low-cost (under $500) Windows-based program that enables you to edit and enter information, create and read cookies, perform conditional queries, dynamically send mail, create thread-based discussion groups, create order forms, and even create "shopping cart" systems. Cold Fusion uses a template language called DBML (Database Markup Language) to create queries on your database and structure the results, so no CGI or C++ coding is required, and getting your database on the Web is fairly easy. (DBML tags are similar to HTML tags, which makes them easy to use and understand.)

With Cold Fusion, developers can build applications by combining standard HTML with high-level database commands stored in templates (which is theoretically faster and more flexible than first generation, code-intensive techniques). Using Cold Fusion, developers can create dynamic Web sites and full-scale Web applications.

The basic functions of Cold Fusion are

A Cold Fusion Web application uses templates instead of static HTML documents. A template is a text file that contains both HTML and Cold Fusion's Database Markup Language (DBML). Rather than being sent directly to the user's browser, templates are first processed by Cold Fusion, which generates a standard HTML page that is then sent to the viewer's browser. DBML contains a set of commands that tell Cold Fusion how to interact with the databases, validate form submissions, and process database output. (See Figure 13.1.)

Figure 13.1. How Cold Fusion works when a Web browser invokes a Cold Fusion template, straight from the horse's mouth.

Here's how it works:

  1. The viewer clicks the Submit button on a form or a hypertext link on a page; the viewer's Web browser then sends a request to the Web server.
  2. The server opens a Cold Fusion process, passing it the data submitted by the browser and pointing it to the appropriate template file.
  3. Cold Fusion then reads the data from the client, in turn processing DBML commands used in the template, including the type of request to send to the database and the format that should be used to present information to the results page.
  4. Using ODBC, Cold Fusion interacts with the database.
  5. A dynamically generated HTML page, containing the results of the form submission or query, is returned by Cold Fusion to the Web server. (Cold Fusion can also dynamically generate e-mail messages containing the results of the query.)
  6. The Web server sends the generated HTML page to the viewer's browser.

This system is very flexible because of the wide range of database interaction and data handling options available through DBML. Though Cold Fusion isn't the fastest program on the market, and is limited in the functions that are available, it is worthy of consideration.

Overall, Cold Fusion is simple to use, inexpensive (for a commercial product such as this), includes pretty good documentation, eliminates the need to learn complex CGI programming in order to provide crucial features (for example, customizing Web pages, tracking users, integrating databases), and is flexible enough to be used by small companies to create good live database applications. If you have to put your live database on the Web, but aren't ready to commit to a product that requires strong programming skills—or a large monetary investment—Cold Fusion could be just the ticket.

Sapphire/Web 2.0

This visual application builder is designed specifically for creating applications running on the Web (and for internal webs). Sapphire/Web has a "visual programming paradigm" that reportedly reduces the coding effort normally associated with developing applications.

Source: Bluestone Inc. (http://www.bluestone.com); free demo available.

Databases supported:

Platforms Supported:

Additional requirements: Microsoft Visual C++ 4.0 on the NT version; a C or C++ compiler on the UNIX version.

Web servers supported:

Overview

This is a UNIX/Windows NT visual action builder enabling developers to create database applications for the Web. Sapphire/Web comes with documentation and uses CGI to interface with databases. Creating an application takes six steps:

  1. Create your HTML forms (for data input and request) and HTML templates (that will hold data returned to the end-user from your application). These can be created in any HTML authoring tool
  2. Browse your application objects from Sapphire/Web. These can be
  3. Select the appropriate object, and Sapphire/Web will bring up an Object Bind Editor with appropriate arguments, results, and special editors.
  4. Drag and Drop from your HTML documents and components onto the Object Bind Editor. This "binds" HTML elements such as a text input field or an option menu to arguments and results returning from your object to other HTML elements such as an ordered list or table. Sapphire/Web automatically populates the returned data into your HTML Templates.
  5. Add conditional processing code, or modify the default methods of populating data.
  6. Generate code in pure C or C++. This generates a CGI program for immediate use. That's all there is to it!. You can also test and load the CGI program in the specified HTTP server's CGI directory using Sapphire/Web.

Sapphire/Web is a versatile program. They say you can create anything with it that you can make with Cold Fusion and a lot more, and the program you end up with will purportedly be faster and more stable. Another bonus is that it supports the use of framed pages. Of course you'll pay for these advantages, not only monetarily, but with time (and possibly frustration). Although they say it is possible to use Sapphire/Web without being an expert C++ programmer, the potential of the product cannot be tapped without previous programming and database experience.

NetDynamics 1.0 Beta

According to the manufacturer, NetDynamics integrates visual development, WAN-scaleable database access, and a high-performance Java application server into a robust architecture for swift delivery of commercial grade Web/database applications.

Source: Spider Technologies Inc. (http://www.w3spider.com); free demo available.

Databases supported:

Platforms supported:

UNIX Application Server:

Other requirements: The current Sun Java Development Kit.

Web servers supported:


Overview

NetDynamics provides an environment for utilizing Java in business applications. Development is promoted through the use of graphical wizards and palettes that automatically generate Java code, hiding the complexity of building Web/database applications and reducing the effort and cost of deployment.

It offers scalability within a single system or over multiple machines, and incorporates security features (like secure session ID, navigation controls, and access privileges) that enable it to interoperate with industry-standard Web and database security mechanisms. It is claimed to be an "open" solution in that it is supported by any Web server, forms-capable Web browser, HTML editor, and all major database systems and ODBC-compliant databases on both UNIX and PC platforms

Many very useful sample applications are included with NetDynamics, including a shopping-cart project, a simple table-editing project, a three-tier project, and others.

The NetDynamics Studio is where most of the real work is done. It's a GUI that displays your current project in a nifty graphical hierarchy. It features tools, menus, palettes, and editors with which you create new items or make changes to items that already exist. The "palette" (which if you are accustomed to using Visual Basic or another graphical development tool you will find very easy to use) contains various tools such as Insert HREF, Insert Data Field, Insert Page, Insert Button, or Insert Security Object.

Wizards provided are a Security Wizard, a Page Template Wizard, a Data Object Wizard, and a Data Source Wizard. These wizards allow for speedy development of applications by guiding you swiftly through the development process without burying you in details. After using the wizards to create your project, you compile the project and test it in your browser. If you wish to make any additional changes, you can use the Palette and Inspector and recompile.

Although NetDynamics doesn't require you to be a Java expert in order to create applications, making changes in the source code is a lot easier if you have some Java expertise, or C++ experience at the very least. NetDynamics should be easy to use (for someone with some programming knowledge), highly configurable, and should work with practically any database. The Java application server is said to speed up the use of SQL processes by as much as 10 percent over normal C++ CGI code. It's fast and very flexible, and uses Java—which some say is the future of Web application development.

Keeping It Simple


The simplest way (provided you don't need to update your information very often) to provide your product information online is without the use of a database. Using just basic navigational aids and a good hierarchical web structure, you can create an easy-to-use product information site (see Figure 13.2).

Figure 13.2. L.L. Bean's well-organized (albeit slow to download) catalog site.

If your product line is large, it would be a very good idea to provide an internal search engine within this site. The most important thing to remember when organizing a site such as this is the same as with any site: View your site as your viewers do. Special attention should be paid to separating your products into distinct areas. (For example, for a clothing manufacturer there would be separate areas for men's clothing, women's clothing, children's clothing, pants, shirts, and so on.)

From the Web and onto Your Database—Using the Internet for Sales Leads


Using an HTML form and a CGI script, you can easily create a sales lead database on the Web. For this project we will modify the form from the last chapter to include spaces for the viewer's address. We will also have to modify a line of the CGI script (formmail.pl) to send us our e-mail in a different format (more easily read by a database).

The goal of this project is to provide a form for viewers to request a free informational brochure. After the viewers fill out the feedback form and click the Submit button, we want an HTML page to load, letting the viewers know we've received their form and thanking them for their time. In addition, we want our text brochure to be e-mailed to them automatically. We also want the information they provided to be sent to our e-mail box in a manner readable by the database (for instance, Microsoft Access).

So, there are four separate files we must create in developing this form system: the HTML form itself (which will be discussed in detail in Chapter 14, "Mail Delivery Systems"); the CGI script with which to decode it (formmail.pl, as discussed in Chapter 11, "Integrating HTML with CGI," with a small modification); the "brochure" to be mailed to them (which is any e-mailable file); and the HTML redirect page (which is also discussed in Chapter 11).


Note

The modification for the CGI script is very easy; simply change the code



[print MAIL "$name: $value\n"]

to read




[print MAIL "$name,$value,"]

This is saying to separate the fields by commas (comma-delimited text is easily read by most databases). That's it!


And here's how it works: The viewer clicks on the feedback link from the home page and arrives at our HTML form. They fill out the form (Figure 13.3) and click the Send The Form button.

Figure 13.3. How a viewer fills out this form example.

The form is then submitted and the viewer jumps to the thank you page (See Figure 11.6 in Chapter 11.). At the same time, the informational brochure we promised is forwarded to the viewer's e-mail box.

Our form contents then arrive in our e-mail box, where we can save it as text (see Figure 13.4).

Figure 13.4. How the form contents look when we get them via e-mail and save them as text.

Entering this information in a database is truly simple, as most database applications allow simple importation of comma-delimited text. If your own database prefers a different layout for text input, you can make the adjustment in your CGI.

If you are running your own server, you can automate the input (which is obviously preferred) in several ways. The simplest way is to have dynamic input for your database, which will require a special CGI script/application. This configuration will depend on your database and server, and instructions may be included with your software. The second way to import directly is to give your database an e-mail box and have it import information from that.

Can Customers Find What They Are Looking for Quickly?


On a small site with good navigational aids and narrowly defined subject areas, customers should have no trouble finding what they are looking for. However, after a site grows more complex, a good internal search engine may be necessary to aid in the site's user friendliness. (After all, no matter how good your widgets are, they won't sell if no one can find them, right?)

A Cool Free Product: Excite for Web Servers


If you are running your site off your own server, there are some commercial "ready-made" products available for performing searches of your site, the most popular being Excite for Web Servers (Figure.13.5).

Figure 13.5. Excite for Web Servers.

Excite for Web Servers (EWS) is a new generation of Web navigation software. It gives your Web site the same search capabilities used by the Excite service (as well as the sites hosted by Netscape, Sun, Info World Electric, HotWired, Chevron, United Airlines and others).

EWS supports the following platforms:

To run the software, you need a minimum of 32MB of RAM and enough disk space for the following requirements:

ETW uses the following searchable document formats:

EWS's underlying concept-based architecture was developed specifically for the Internet by Excite. This architecture supports not only searching (which assumes the viewer knows exactly what they're looking for), but browsing and exploration as well. In other words, with Excite for Web Servers, viewers don't need to know the right keywords, they can simply describe what they're looking for in their own words.

EWS quickly returns a list of documents ranked by confidence (of keyword match), and is unique in its capability to let users sort the search results list by subject. This helps them understand what's on your site and how it's organized. Another unique feature is that when a viewer finds a document he or she likes, EWS's query-by-example (with a simple click) can hunt down more just like it. An additional feature is the EWS Notifier, which automatically updates the Excite search service's master index with information on your site when you add content.

Although Excite for Web Servers is free, the company currently sells maintenance agreements (which include upgrades, as well as e-mail and phone support) for $995 per year per installation. EWS contains all the functionality you need to add searching to your site—which means you do not need to purchase other products, such as a database, to use it.

Excite claims you can have EWS up and running in just 30 minutes since it writes all the CGI scripts and HTML pages for you (yeah, no programming!). You simply fill out a few forms and point EWS to your Web documents, and it creates a custom, concept-based index of the contents of your site in minutes.

Here is how the company says the installation process works, and how it can be done in under 30 minutes (times are approximate):

Step 1: Download your copy of Excite for Web Servers. (3 minutes 30 seconds)

The time varies, depending on your network connection.

You can download Excite for Web Servers free from




http://www.excite.com/navigate/download.cgi.

Step 2: Register EWS with Architext. (4 minutes)

Once you've agreed to the license terms, you will need to fill out their registration form.

Step 3: Configure your collection of documents. (4 minutes)

You will need to enter a name for the collection, and tell EWS which files you want included.

Step 4: Index your document collection. (3 minutes 30 seconds)

The exact amount of time needed depends on the size of your collection.

EWS is kind enough to send you an e-mail when it's done; 300MB can be indexed by EWS in about an hour on a single processor workstation.

Step 5: Add your search page to your site. (2 minutes)

You simply define how you want your search page to look by filling out a form, and after it's defined, EWS will create the search page, along with all the necessary CGI scripts. Link the search page to your site, and you're up and running!

That's all you need to do to make your site more searchable with Excite for Web Servers. It's a strong product and, considering the price, we recommend that you at least check it out.

Figure 13.6. Excite for Web servers in action at the Reynold's Metals Company site.

Quick and Dirty Guide: Using WebMania For Sales Leads


In Chapter 11 we used WebMania to produce an HTML form. After reading that section, you were most likely left with the question: "OK, so how do I read the submitted form, and how can I import that information to a database?" Well, that's what we explain in this Quick and Dirty Guide.

After your viewer submits the WebMania form, an e-mail arrives. Now, there are a couple of ways you can get that information into WebMania (to enable you to read it). One way is to directly import it, which means you can check your e-mail from within WebMania—you can find out how to do this by reading the Importing (direct) subject in WebMania's help system. (We did not use this method, however, since this e-mail address gets standard e-mail as well.) The other (more indirect) way of retrieving the form information is by saving the e-mail (after receiving it) as text. After you have saved the e-mail as text, it is very simple to import this data. Here's how:

  1. Open WebMania.
  2. In the File drop-down menu, click Response|Import.
  3. Find your text file and double-click on it; it will then appear in the import list.
  4. Click the OK button.
  5. To view the response, click Response|View[el] and select your form.
  6. You can then browse through the information.
  7. To export this information to an Access database, in the File menu choose Response|Export.
  8. Select the form to export and click OK (note the name WebMania assigns to this Access file).
  9. Open the Access file to view results and make any formatting changes necessary (Figure 13.7.).

Figure 13.7. How a viewer submits a WebMania form.

Summary


In this chapter we have discussed an overview of databases and their use with Web sites. We have also presented brief overviews of several commercial products available for linking your server to a database.

There is ample information on this subject available on the Net, and you should research the subject carefully before investing in a single product. The purpose of this chapter is to provide an overview only, and not to recommend any specific product over another.

The next chapter deals with e-mail delivery systems and the use of e-mail in communication.

Previous Page Page Top TOC Next Page