CGI
- The Common Gateway Interface is a method for
generating web pages dynamically.
- Instead of interpreting the argument of GET (or POST) as a
filename, its interpreted as a program name with arguments.
- The URL for a GET is interpreted as
programname?parameter1=value1¶meter2=value2&..... The
values are optional. The parameters and values are passed as
command-line arguments to the program.
- For a POST, all the parameters and values are passed to the
program in the standard input. That is, as thought a person had
first run the program and then typed the information on the
keyboard.
- The program is run and whatever it prints out is sent back
to the client.
- CGI programs run as independent processes and so have many drawbacks:
- They consume a lot of system resources.
- They suffer from startup delays.
- It is hard to maintain state between successive calls
(must write to file).
- It is because of these reasons that server-side systems were
introduced. These include Java servlets, PHP, Zope, IBM's
Websphere, etc.
José M. Vidal
.
17 of 18