Tuesday, May 12, 2009

Common Gateway Interfacesssss 2


sssssThe Common Gateway Interface (CGI) is a standard for interfacing

external applications with information servers, such as HTTP or Web

servers. This technology used for generating dynamic web documents. CGI

specifies how a server interacts with an application program that builds a

dynamic document. CGI only provides general guidelines, leaving the

programmer to choose the most suitable programming language for the job.

CGI is not magic; it is just programming with special types of input and some

strict rules on output. Any languages able to interrogate its environment

variables, read its standard input, and write its standard output can use CGI.

Figure 1 illustrates the steps in creating a dynamic program using CGI


sssssThe CGI program in its simplest form is code written in one language

supporting CGI. Any programmer who can encode a sequence of thoughts in

a program knows the syntax of C, C++, Perl, etc. can write a simple CGI

program (Forouzan, 2007). There really is no limit as to what you can hook up

to the Web. The only thing you need to remember is that whatever your CGI

program does, it should not take too long to process. Otherwise, the user will

just be staring at their browser waiting for something to happen.

Figure 1 Dynamic document using CGI