Wake up your Web page

If your Web server is part of your business solutions, you'd better have a database engine connected to it--or you're toast. Without database connectivity, personalizing and customizing your Web presence is an overwhelming task, and "personalize, customize" is now the Webmaster's mantra.

In case you haven't heard, static Web pages are about as exciting as Lawrence Welk's 20-year reunion show. To see how database connectivity can jazz up your Web page, look at the Microsoft Network home page, www.msn.com.

"So what," you say. "I'm just setting up a corporate intranet. All I want is our company phone list and maybe some employee benefits information on a Web page. Why do I need a database?"

Well, go ahead and create Web pages for every possible phone list and employee benefit. But can't you just hear your users soon demanding the capability to search by first name, or maybe department, or last name, and on and on? Then your company has a hiring spree, and you're spending so much time updating your static pages that you can't handle all the new requests, including a new job posting page and a 401K page complete with pie charts and bar graphs to plot progress.

So what's the answer? Database connectivity. With a database managing all the information and with a database connectivity product such as WebBase or CGI PerForm, you can dynamically display information any way you or your users see fit.

Connecting a database to a Web server is pretty easy. Many available packages make it as easy as installing Web server software. We reviewed two of these packages (see "dbWeb 1.0 and Cold Fusion 1.5," Windows NT Magazine, April 1996). Microsoft purchased dbWeb after our review, and will release it as Microsoft dbWeb. Two other outstanding packages are CGI PerForm (visit http://www.rtis.com/w3toolkit/perform) and WebBase by ExperTelligence (at >http://www.webbase.com). Open Database Connectivity (ODBC) lets all these packages provide excellent database integration and connectivity. Standard ODBC drivers that come with NT and most database engines let WebBase support more than 50 databases.

So how does database and Web connectivity work? All these database connectivity products have unique charms, but most work the same way.

Let's take WebBase, retrieve some information from a table, and display it as a dynamic Hypertext Markup Language (HTML) page. This example works with a standard Web page that asks users to input an employee name (such as Denny) to search for. This page is created with standard HTML, except that the Submit button does the following GET request from the WebBase server:

http://test.com:80/getname.htf?name=Denny

The special file GETNAME.HTF controls how to query the data and how you want to store the returned information. Here's an example .HTF file:

<HTML>

<HEAD>

\{sql to answers source 'Primary'
user 'Administrator' password
'Secret' max 25\}

SELECT * FROM Examples where
name LIKE '%(name)%''

\{/sql\}

<TITLE> WebBase Demo Results
</TITLE>

</HEAD>

<BODY>

Search Results for
\{%search%\}

\{forRow aRow on answers\}
<HR><PRE>

Name: <B>\{Name\}</B>

Extension: <B>\{Extn\}</B>

Email Address: <B>\{Email\}</B>

</PRE>\{/forRow\}

</BODY>

</HTML>

WebBase substitutes the variable Denny for (name) and performs the SQL select from the Companies table of the Primary ODBC data source. The query will return up to 25 records. This feature is very important--as you know if you ever get a query that returns 10,000 records. Imagine building that Web page at 14.4Kbits per second!

Next, theforRow construct loops through the results. The variable aRow takes on each result as the query returns it. For the place holders \{Name\}, \{Extn\}, and \{Email\}, WebBase substitutes the values that the query returns from the table. Now you have Web database connectivity.

You don't need a quad-processor Alpha system with 10GB of disk space to run a database engine. A 486 with a modest amount of RAM and disk space will do the job. For software, start with a readily available product such as Microsoft Access. All the software packages I mentioned support Access via ODBC. This setup lets you handle simple queries and small databases at low volume, but it's a start. Once you get a taste of what database connectivity can do for your Web pages, you'll never let your users choke on static pages again.

Off the Shelf
Another product that lets you turn the unintelligible gibberish that is a log file into meaningful information is WebTrends from e.g.Software. Download a full, working, 15-day trial version at http://www.webtrends.com. The only limit is the trial period. You can create reports that vary in style and complexity: from a simple list of who accessed your Web site and what they did (translated from a log file into plain English) to full-color 3D bar charts detailing users by country, state, and even city. WebTrends also gets as detailed as you want, providing reverse Domain Name System (DNS) lookup at report time (so your server doesn't have to waste time doing it). WebTrends also translates those pesky error codes like "403" into meaningful English, like "error 403, failed forbidden." Add event scheduling for translating the log files (handy if you have a big site) and extensive filtering capabilities, and you have a package any Webmaster will give a home page for. As a matter of fact, if you provide a link from your home page to WebTrends' home page (http://www.egsoftware.com), the company will give you a 50% discount off the list price. For more information, email info@egsoftware.com.

When your Web server generates terse information in a log file, another product, DistStat, turns it into statistical information that you can distribute by email to any number of people. If you are hosting pages or Web sites for other businesses or vendors, this tool can be very useful. Get an evaluation copy at http://www.rtis.com/nat/software/diststat/docs/eval.htm.