CGI Tutorials and Resources

CGI — Common Gateway Interface — is a protocol for connecting communicating between a web server and an application running on the host server. CGI technology was an important driver for the first wave of truly interactive websites in the late 1990s. While the original CGI protocol has mostly fallen into disuse, its descendant still power a large portion of the world wide web.

CGI Tutorials

CGI is one of the oldest technologies of the interactive web, and there are a lot of tutorials about it. These are some of the best, each one offering a slightly unique viewpoint on CGI scripting.

Reference and Resources

Most of the CGI-related pages on the internet are very old, and only some of them are even remotely relevant for today. We have combed through the available resources, to provide you with only the ones that are useful (or, at least, interesting).

Books on CGI

  • CGI Programming with Perl (2000), by Guelich, Gundavaram, and Birznieks, from O'Reilly, is one of the best books on the topic. It is relatively advanced, and is aimed at professional programmers.
  • CGI Programming on the World Wide Web (1996), by Shishir Gundavaram, is another excellent book on the topic from O'Reilly. This is not as comprehensive a resource as the one listed above, but it's still packed full of information.
  • Cgi How-To: The Definitive Cgi Scripting Problem-Solver (1996), by Asbury, Mathews, and Sol, is a classic, imminently practical how-to book on CGI, covering Python and C.
  • Instant Web Scripts With Cgi Perl (1996), by Sol and Berznieks, is a "cook book," of useful CGI scripts.
  • CGI Developer's Guide (1996), by Eugene Eric Kim, is a comprehensive guide and reference book for working with CGI in Perl.
  • CGI Manual of Style (1996), by Shevchik and McDaniel, is a unique book. It examines several popular CGI scripts, pointing out how they were written and providing pointers for writing CGI scripts with good style.
  • Perl and CGI for the World Wide Web (2001), by Elizabeth Castro, is part of the Visual QuickStart series, explaining CGI and Perl programming in a simple, easy-to-follow format.
  • Sams Teach Yourself CGI in 24 Hours (2002), by Rafe Colburn, is a very fast introduction to CGI, ideally suited for programmers with some Perl experience.
  • CGI: Internet Programming in C++ and C (1997), by Mark Felton, is one of very few books that provides information on CGI with low-level operating system languages C and C++.
  • CGI Developer's Resource (1997), by J M Ivler, is designed as a sort of cook-book or desk reference, containing hundreds of CGI scripts, with comments and explanations.
  • CGI Programming 101 (2000), by Jacqueline D Hamilton, takes the reader from very basic CGI introduction to advanced concepts, including connecting to databases and writing custom Perl modules.
  • CGI Programming With Tcl (1999), by David Maggiano, is a rare book on CGI, showing how to use the technology with the Tool Command Language.
  • Writing CGI Applications with Perl (2001), by Meltzer and Michalski, is a highly practical book on CGI and Perl, covering all of the relevant use cases and concerns, including databse connections, security, and RSS.
  • The CGI/PERL Cookbook (1997), by Patchett and Wright, contains 20 popular CGI scripts, and provides line-by-line explanations of them.
  • The Web Wizard's Guide to Perl and CGI (2002), by David A Lash, covers both practical coding concerns like other books, but also discusses usability, audience retention, and user data analytics.

Should I Use CGI?

In modern web development, CGI has largely been replaced by a large number of alternatives. For conventional web server scripting, two descendant of CGI: Fast CGI and Simple CGI have taken over. Additionally, many web development platforms like Node.js or Java act as their own web server.

Further Reading and Resources

We have more guides, tutorials, and infographics related to coding and development:

What Code Should You Learn?

Confused about what programming language you should learn to code in? Check out our infographic, What Code Should You Learn? It not only discusses different aspects of the languages, it answers important questions such as, "How much money will I make programming PHP for a living?"