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


  Another technique to consider is using function stubs. Suppose you decide that a single routine to print both yen and dollars is actually the most efficient way to go. But you already have separate subroutines, and your old programs wouldn’t know to pass the additional parameter to the new routine. Rather than going back and modifying each program that calls the old routines, just “stub out” the routines in your library so that the only thing they do is call the new, combined routine with the correct parameters. In some languages you can do this by redefining the routine declarations; in others, you actually need to code a call and pay the price of some additional overhead. But even so, the price is far less than that of breaking all your old programs.

Public Libraries

The Internet is rich with public-domain sample code, libraries, and precompiled programs. Although most of what you’ll find is UNIX-oriented (because it has been around longer), no shortage exists of routines for Windows NT.

The following is a list of some of the best sites on the Internet with a brief description of what you’ll find at each site. This list is far from exhaustive. Hundreds of sites are dedicated to or contain information about CGI programming. Hop onto your Web browser and visit your favorite search engine. Tell it to search for “CGI” or “CGI libraries,” and you’ll see what I mean. To save you the tedium of wading through all the hits, I’ve explored many of them for you. The following are the ones that struck me as most useful:

  http://www.worldwidemart.com/scripts/—The justifiably famous Matt’s Script Archive. Look here first for tested, practical scripts in Perl and C for many common business uses.
  http://www.ics.uci.edu/pub/websoft/libwww-perl/—This is the University of California’s public offering, libwww-perl. Based on Perl version 5.003, this library contains many useful routines. If you plan to program in Perl, this library is worth the download just for ideas and techniques.
  http://www.w3.org/CGI/— The W3C standards organization CGI site. W3C is always worth a periodic visit.
  http://www.itm.com/cgicollection/—A vast collection of CGI script that you can use and learn from. It covers CGI security and contains tutorials and other examples.
  http://www-genome.wi.mit.edu/WWW/tools/scripting/cgi-utils.htmlcgi-utils.pl is an extension to cgi-lib.pl from Lincoln D. Stein at the Whitehead Institute, MIT Center for Genome Research.
  http://www-genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.htmlcgi.pm is a Perl 5 library for creating forms and parsing CGI input.
  http://www-genome.wi.mit.edu/WWW/tools/scripting/CGIperl/—This is a useful list of Perl links and utilities.
  http://www.boutell.com/gd/—A C library for producing GIF images on-the-fly, gd enables your program to create images complete with lines, arcs, text, multiple colors, and to cut and paste from other images and flood fills, which get written out to a file. Your program can then suck this image data in and include it in your program’s output. Although these libraries are difficult to master, the rewards are well worth it. Many map-related Web sites use these routines to generate map location points on-the-fly.
  http://www.boutell.com/cgic/—A CGI library providing an easier method to parse CGI input using C.
  http://stein.cshl.org/WWW/software/GD/GD.html—GD.pm, a Perl wrapper and extender for gd, is written by Thomas Boutell of Cold Spring Harbor Labs.
  http://www.iserver.com/cgi/library.html—This is Internet Servers Inc.’s wonderful CGI library. Among the treasures here, you’ll find samples of image maps, building a Web index, server-push animation, and a guest book.
  http://www.charm.net/~web/Vlib/Providers/CGI.html—This collection of links and utilities will help you build an editor, use C++ with predefined classes, join a CGI programmer’s mailing list, and best of all, browse a selection of Clickables, Plug and Play CGI Scripts.
  http://www.greyware.com/greyware/software/—Greyware Automation Products provides a rich list of shareware and freeware programs for Windows NT. Of special interest are the free SSI utilities and the CGI-wrapper program, CGIShell, which enables you to use Visual Basic, Delphi, or other GUI programming environments with the freeware EMWAC HTTP server.
  http://www.greyware.com/greyware/bulletins/iis-cgi-faq.html—FAQ on enabling CGI on Microsoft’s Internet Information Server (IIS) Web server.
  http://www.bhs.com/—Although not specifically geared to CGI, the Windows NT Resource Center, sponsored by Beverly Hills Software, provides some wonderful applications, some of which are CGI-related. In particular, you’ll find EMWAC’s software, Perl for Windows NT and Perl libraries, and SMTP mailers.
  http://mfginfo.com/htm/website.htm—Manufacturer’s Information Net provides a rich set of links to Windows NT utilities, many of which are CGI-related. Of special interest are links to back end database interfaces and many Internet server components.
  http://website.oreilly.com/—Bob Denny, author of WebSite, has probably done more than any other individual to popularize HTTP servers on the Windows NT platform. At this site, you’ll find a collection of tools, including Perl for Windows NT, VB routines for use with the WebSite server, and other interesting items.
  ftp://ftp.ncsa.uiuc.edu/Web/httpd/Unix/ncsa_httpd/cgi—NSCA’s CGI Archive. Don’t miss this one!
  http://www.cgi-resources.com/—The CGI Resource Index, another good CGI site.
  http://www.perl.com/perl/faq/—The Perl Language Home Page’s list of Perl FAQs. Check out the rest of the site while you’re there.
  http://www.w3.org/Security/Faq/www-security-faq.html—Frequently asked questions about CGI security issues.

These sites should be enough to get you started. For a fresh list of sites, start looking on http://www.yahoo.com/ or use your favorite search engine.

The Future of CGI Scripting

The tips, techniques, examples, and advice in this book will enable you to create your own scripts immediately. You should be aware, however, that the CGI world is in a constant state of change, more so perhaps, than most of the computer world. Fortunately, most servers will stay compatible with existing standards, so you won’t have to worry about your scripts not working. Here’s a peek at other CGI-like options available for programming interactive sites.


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.