1.2.4. Common Gateway Interface
Definition
"Common Gateway Interface (CGI) is an important World Wide Web technology that enables a client to request data from a program executed on the Web Server. CGI specifies a standard for passing data between the client and the program." (WIKIPEDIA)
Connection of Client, Server and CGI ProgramAs you have seen in the unit URL we are
able to execute queries by entering the query-strings (e.g.
?q=cartouche&q=e-learning) directly in the URL. These parameters are
sent to the server. Since the Web Server cannot handle these query parameters
a
Common Gateway Interface is necessary to process the data.
In the unit
URL we used the query-string
"?q=cartouche&q=e-learning" with the parameters "q=cartouche" and
"q=e-learning" in a searching machine to look for documents (web pages, pdf
etc.) that contain these terms. But what happens with these terms? The following
graphic gives you the solution.
Important is, that the server calls the CGI to process the data. The CGI response is mostly an HTML-code, but it can also be in the form of XML, SVG, JPEG, etc.
Forms
Often, you do not have to enter the query-strings in the
URL because the Web Page offers a form where you have to enter some terms. This
can be your name, your credit card number, the terms in a searching machine,
etc. After having entered all data, you typically have to click on a symbolic
submit button to initiate the sending of the entered information back to the
server machine.
This process is the same as it is described above. The
input of the completed form is automatically transformed into the URL notation
with the query-string. Therefore the information is sent to the server which
calls the CGI to process the received data.
You find a typical form when using a search machine on the Web. You always have to enter the term you are looking for.
Exercise
Enter some searching terms in the search
bar of an arbitrary search machine. After having pressed the
"Start-Search-Button" have a look at the URL that will be created automatically.
You don't have to understand the meaning of every single parameter but normally
the meanings can be guessed.
You can discuss your results
on the discussion board "Internet Techniques", if you want.