COVER STORY ONLINE
WINDOWS Magazine, July 1997
Rev Up the Web for Free || Editor Mike Elgan on the Web ||
Message Exchange || Reviews and Related Resources || July Issue ||
Go to Cover Story Online Front Page

INSIDE ...

Introduction

Well Connected
Browsers Get Better
Perfect Plug-Ins
Useful Utilities
Find It Fast
Cookie Monsters
Search Success

Modem Mastery
Quick Connections
Ready, Willing and Cable
Tune In to the Web

If You Build It, They Will Come
Construction Sites
Picture This
Action!
Sounds Good
Action ... Reaction
The Next HTML
ABCs of CGI

A Host of Hosts
Serve Yourself
Watch What Gets In
Know Who's Visiting
Find a Gracious Host
Get Surfers to 'Hit' on You

WEB EXCLUSIVE
The Top 20 Business Sites

ABCs of CGI
Pick a language and fetch data at your site.

Interactive Web pages, like the ones that ask visitors to fill out a form, may use the Common Gateway Interface (CGI) to send the form's data to the server. For example, a car-buyer's Web site could be using CGI when it displays a query screen to capture requested information such as desired car model and price range.

Behind the scenes, a request for an inexpensive sports car travels to the server, according to the CGI rules. A CGI script then searches the database for the pertinent information, and the results are placed on an HTML page and sent back to the browser. This ability to create a page on the fly, based on input from the user, is one of the main reasons Web developers love CGI.

Although you will hear the phrase "CGI script," CGI is not a language. Rather, it's a set of protocols that defines how a client and a server exchange data. A CGI script is an implementation of that protocol and can be written in any of several programming languages. The most common scripting language is Perl, although a developer can use C, C++, REXX and Basic-as well as other languages-to write CGI scripts.

Despite site creators' early acceptance of CGI, many ISPs prohibited CGI's use within sites they hosted, fearing that poorly written scripts would disrupt their Web servers. These days the ban has eased, but developers should check with their hosting service before committing to CGI.

Eventually, CGI may be eclipsed by other ways of creating interactive Web pages and produce faster applications. The leading contenders to unseat CGI are NSAPI and ISAPI, the application programming interfaces supported by Netscape and Microsoft's widely used Web servers.


A Host of Hosts: Serve Yourself