Join Bill Weinman for an in-depth discussion in this video What is CGI?, part of CGI Essential Training.
What is CGI? CGI stands for Common Gateway Interface. This is not to be confused with the other CGI, which stands for Computer Generated Imagery, which is the technology that they use for special effects and explosions and things in major motion pictures. This is CGI, the Common Gateway Interface. This is the technology that allows web browsers to submit forms and interact with programs on a web server. So, when you see a web form like this one here, and you fill it in and you press the button and it goes, what happens from this point is CGI.
The web browser submits the data to the server. The server passes that data on to an application. The application responds and it goes back up the chain, back to your web browser, and your web browser gets some kind of result and maybe something happens on the backend, like a database thing or sending an email or something like that. CGI is used for simple interactive applications. More complicated applications like Google Maps or Gmail or something like that, use another technology called Ajax, which sometimes actually uses CGI on the backend to communicate with the applications on the server.
But CGI is used for simple interactive applications. CGI applications can be written in any programming language. The most common ones are languages like Perl and PHP and Python and things like that that tend to be simple languages. Because CGI applications tend to be simple applications. For this reason, CGI applications are often called CGI scripts, because the languages that they tend to be written in, tend to be what are called scripting languages. They tend to be very simple languages.
And for this reason, they're often called CGI scripts. Of course, they can be written in any language. Sometimes more complex languages like ASP or Java or even C++ can be used, but it's important to note that CGI applications run in the server. They do not run in the web browser. So, the technology that's used by the CGI application must be supported by the web server. And the requirements of running applications on the server and the security restrictions and things like that must all be followed according to the rules of the server and not according to the rules of your local computer or your application.
And this is because CGI applications run in the server and not in the web browser. So, we'll cover more of the details as we move along in this course, but in a nutshell, that's what CGI is.
- Understanding the server requirements for CGI
- Installing CGI scripts on Unix and Windows servers
- Coding form elements into an HTML page
- Keeping context with hidden fields on a web form
- Learning best practices for creating CGI content