CGI: The Birth of Server Side Web Programming

As with most computer jargon, the term Common Gateway Interface can be fairly meaningless at first glance. So, before getting into what CGI can do, let's take a moment to define what CGI actually is.

  • Common - CGI programs can be written with many languages. CGI can be programmed in C, C++, Java, Perl, Visual Basic, or any other language that can accept user input, process that input, and respond with output.

    Further, CGI works with many different types of systems. CGI works on Mac, NT, Windows, OS2, Amiga, UNIX, and pretty much every operating system that runs web server software.

    By the way, if you use a "platform independent" language like Perl or Java to write your CGI script, the exact same CGI script can be moved directly from one platform to another without it breaking! (4)

  • Gateway - CGI's usefulness does not stem from what it can accomplish by itself, but what it can accomplish by making partnerships with other resources.

    I often see CGI as a middleman or a translator whose job it is to help more powerful resources like databases, graphics generation programs, or network applications talk to each other and work towards a common solution.

    CGI is the gateway between the lone web surfer with her trusty web browser and the vast web of computers (each with their own specific language and protocols) and computer programs (each with their own interfaces and methods of output).

    CGI translates between the language the client speaks (perhaps HTMLized English) and the multitude of languages spoken by the resources the client wants to utilize (such as SQL for relational databases). This is a crucial job, cause let me tell ya, my grandmother does not want to know how to speak SQL when she is browsing the web!

  • Interface - CGI is not a language. Neither is it a program. CGI is a standard of communication, a process, an interface that provides well-defined rules for creating partnerships. The benefit is that if everyone follows the rules of the interface, then everyone can talk to each other. Thus, typically we say that we write "CGI programs" or "CGI scripts" that perform the functions of the common gateway interface.

Let's look at the CGI processes in the following chart.

Okay, so that is probably a lot of abstract stuff to take in all at once, especially if you have not worked with CGI already. So let's back up a minute and go over what CGI is by looking at it in the wild. Let's look at some examples of CGI in action.

  • Processing Forms - One common use for CGI is providing a way for web surfers to enter data into HTML forms and send that data to some site administrator. With a feedback form, the web surfer can not only read pre-prepared HTML documents, but can actually send feedback in response. Forget about doing that with HTML alone. This form processing script actually takes the data input by the web surfer and sends it as e-mail to the form administrator.

    Another common form processing application is the guestbook that allows web surfers to leave publicly readable greetings. The CGI manages a common file on the web server that everyone can read and write to.

  • Discussing Things - More than simply allowing clients to "talk back", CGI helps in creating an ongoing dialog between multiple clients. Bulletin Board System that actually lets many people collectively create an archive of related messages. And when you're done with that, check out how CGI implements Realtime Chat that allows people to chat anywhere in the world in real time (as if it were a telephone call but typed)

  • Shopping - CGI has also been very useful in selling products on the web.

  • Databases - Finally, CGI can be used to manage databases.

You can easily see that CGI makes for a much more profound surfing experience allowing web sites to offer useful and compelling services to surfers who may be interested in information or products offered. (5) However, there is a dark side!


Related Articles

  • The Power of Windows Hosting - Save Time and Money
    The Windows Server environment will give you far more freedom and flexibility to run a wide range of web applications and allow you to get a dynamic web site up and running fast.
  • Linux Hosting Vs Windows Hosting
    Linux hosting traces its birth from Linux, an open-source computer operating system based upon the concept of free software available to anyone to freely use, improve, modify and even redistribute. Windows hosting, on the other hand, relates to Windows operating system wherein the software is pr.....
  • Introduction to Javascript for Newbies
    Javascript is a client-side programming language whose processing engine is embedded in web browsers like Internet Explorer, Netscape, Firefox, etc. This enables the processing engine to read and interpret web pages that contain the javascript code when browsing
  • Client Side Scripting
    However, this is not to say that other technologies are not extremely useful. Several technologies have proven to be just as important as CGI for the average Internet developer. These technologies focus on putting the demands of computation in the hands of the client instead of the server...
  • CGI: The Birth of Server Side Web Programming
    As with most computer jargon, the term Common Gateway Interface can be fairly meaningless at first glance. So, before getting into what CGI can do, lets take a moment to define what CGI actually is...
  • Windows or Linux Hosting - Which One Is Right For You?
    Which hosting platforms suits your needs?
  • Auto Redirect
    Note 1: You dont have to know PHP programming to do this tutorial. Note 2: I assume that your server supports files with .php extension. If not, you wont be able to do this tutorial. For more info on how to install PHP on your PC go to Php.net...
  • Search Engine Friendly Website Development
    Define: Web Development Web development incorporates all areas of creating a Web site for the World Wide Web.
  • Platform Independent Client-Side Applications with Java
    That very umph comes with Java. Java was originally developed at Sun Microsystems in 1991 to provide a platform-independent programming language and operating system for consumer electronics (TV sets, toasters and VCRs)...
  • I am an Author - is this the Next Big Fad?
    Write an article, get the traffic. Well sort of! Since the birth of writing articles, our industry has caught on to the phenomena of increasing your website

Contact Web Design Outsource and get started today

Need Website Designing, Development, Redesigning, Maintenance and SEO services or help growing your company's web presence? Request a free Quote Now.