Page 341 - StudyBook.pdf
P. 341
Communication Security: Web Based Services • Chapter 5 325
CGI Misconceptions
In discussing CGI programs and CGI scripts, it is not unusual for people to
Head of the Class…. in the CGI language, because there is no such thing. CGI is an interface,
state that CGI is a language used to create the Internet application; how-
ever, this could not be further from the truth. Programs are not written
not a language. As discussed later in this chapter, there are a number of
languages that can be used in creating a CGI program, including Perl, C,
C++, Visual Basic, and others. CGI is not used to create the program itself;
it is the medium used to exchange information between the Web server
and the Internet application or script. The best way to think of CGI is as
a middleman that passes information between the Web server and the
Internet application. It passes data between the two in much the same
way a waiter passes food between a chef and the customer. One provides
a request, while the other responds to it. CGI is the means by which each
of the two receives what is needed from the other.
Typical Uses of CGI Scripts
CGI programs and scripts allow users to have a Web site that provides functionality
that is similar to a desktop application. By itself, HTML can only be used to create
Web pages. It will show the text that was typed in when the page was created, and
various graphics that you specified. CGI allows you to go beyond this, and takes
your site from providing static information to being dynamic and interactive.
CGI can be used in a number of ways. For example, CGI is used to process
information submitted by users, such as in the case of online auction houses like
eBay. CGI is used to process bids and process user logons to display a personal
Web page of purchases and items being watched during the bidding process.This
is similar to other sites that use CGI programs to provide shopping carts, CGI pro-
grams that keep track of items a user has selected to buy. Once the users decide to
stop shopping, these customers use another CGI script to “check out” and pur-
chase the items.
While e-commerce sites may use more complex CGI scripts and programs for
making transactions, there are also a number of other common uses for CGI on the
Web, including hit counters, which show the number of users who have visited a
particular site. Each time a Web page is accessed, a CGI script is run that incre-
ments the counter number by one.This allows Webmasters (and visitors) to view
how often a particular page is viewed, and the type of content that is being
accessed most often.
www.syngress.com

