The Common Gateway Interface (CGI)


The Common Gateway Interface (CGI) is an invaluable tool in World Wide Web (WWW) user interaction. CGI is simply a term that encapsulates the basic idea of processing user input. The process involves some form of submitted data from the user side to the source, and a program from the source which parses this data and spits out a response (either as an HTML document or another form of acknowledgment). CGI is useful in that it can create HTML documents "on the fly." It can also query a database for a given object which the user specifies. Search engines use CGI to locate subjects on the WWW in this way.

   I used the concepts of CGI to produce a guest book application that would enable users to enter contact information and suggestions onto the web. I produced the application using the "FORM" tag with "METHOD=POST" of HTML to create the entry form (See Appendix F-1), and parsed the form data submission with C code (See Appendix F-2 for the code). The C code also enabled HTML creation "on the fly" from the data so that we could see the guest book submissions immediately. The resulting page for the form is displayed in Appendix F-3, and the current guest book contents is displayed in Appendix F-4.

   The guest book is significant not only through its communication uses, but also through its ability to spread contacts. For example, interested users of the CS190 web site could contact others of the same interest just by viewing the guest list and noting the e-mail addresses listed. Users also tend to develop an "attachment" to a site after they have signed in, knowing that their names are now permanently a part of that particular site. This psychological factor contributes in developing a client base.

   Given more time, I would like to create a CGI based system which would allow users to fill out the quizzes and tests that Dr. Klinger has available on-line. The system could also create an HTML document after the submission that would give the results and score of the submitted test immediately. This would give the site a more interactive feel, and would also encourage user interest and participation. The system would also have a search engine that could search the documents for a particular subject.