0% found this document useful (0 votes)
85 views6 pages

CGI - Common Gateway Interface

CGI stands for Common Gateway Interface. It is a specification that allows web servers to interface with external applications. CGI applications reside and execute on the web server, allowing them to process tasks like database searches or form submissions that require server-side processing. In contrast, Java applets run on the client-side browser and are better suited for interactive experiences like games. Websites can employ both CGI and Java by using each where they have advantages - CGI on the server for backend tasks, and Java on the client for frontend validations before passing data to CGI scripts.

Uploaded by

Viplove Mittal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views6 pages

CGI - Common Gateway Interface

CGI stands for Common Gateway Interface. It is a specification that allows web servers to interface with external applications. CGI applications reside and execute on the web server, allowing them to process tasks like database searches or form submissions that require server-side processing. In contrast, Java applets run on the client-side browser and are better suited for interactive experiences like games. Websites can employ both CGI and Java by using each where they have advantages - CGI on the server for backend tasks, and Java on the client for frontend validations before passing data to CGI scripts.

Uploaded by

Viplove Mittal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 6

CGI – Common Gateway

Interface
• Common - interacts with many different
operating systems.
• Gateway - provides users with a way to
gain access to different programs, like
databases or picture generators.
• Interface - uses a well-defined method to
interact with a web server.
CGI Apps vs Java Applets
• CGI and Java are two totally different animals. CGI is a
specification that can be used by any programming
language. CGI applications are run on a web server.
Java is a programming language that is run on the client
side. CGI applications should be designed to take
advantage of the centralized nature of a web server.
They are great for searching databases, processing
HTML form data, and other applications that require
limited interaction with a user.
• Java applications are good when you need a high
degree of interaction with users; for example, games or
animation.
• Java programs need to be kept relatively small
because they are transmitted through the Internet
to the client. CGI applications on the other hand
can be as large as needed because they reside
and are executed on the web server.
• You can design your web site to use both Java
and CGI applications. For example, you might
want to use Java on the client side to do field
validation when collecting information on a form.
Then once the input has been validated, the Java
application can send the information to a CGI
application on the web server where the
database resides
What is CGI?
• A CGI script is a server-side program
launched by a web server to generate a
dynamic document. It receives encoded
information from the remote client (user's
browser) via STDIN and environment
variables, and it must produce a valid
HTTP header and body on STDOUT
• CGI is just a protocol, a formal agreement
between a web server and a separate
program. The server encodes the client's
form input data, and the CGI program
decodes the form and generates output.
The protocol says nothing regarding which
language the program must be written in;
programs and scripts that obey the CGI
protocol have been written in C, shell,
Rexx, C++, VMS DCL, Smalltalk, Tcl,
Python, and (of course) Perl.

You might also like