CGI is not a program itself. This is simply the interface between a webpage running on a browser and a web server that runs the program.
Common Gateway Interface is a specification for interfacing external applications with information servers, such as HTTP or Web servers. CGI program can be written in C or C++, Perl, ASP, PHP, Python, TCL, shells, and many others languages and scripts. CGI is the part of the Web server that can communicate with other programs running on the server. With the CGI, the server calls a program, passes the user specific data to the program. User specific data may include the input that the user has supplied using the HTML form or any other information like what host the user is connecting from etc. The program then processes the data and the server passes the response back to the web browser.
Many of the functionality of CGI can be duplicated by newer technology such as JavaScript and ActiveX.
Benifit of using CGI over these technologies:
As Java, JavaScript, and ActiveX can all be turned off within the browser, besides that many company firewalls disallow these technologies to work in their system (often for security or bandwidth reasons). But as CGI scripts are run on the external Web server, they are not limited by browser or firewall limitations. Therefore by using CGI rather than browser based scripting , you can be sure that all of your readers (with very few exceptions) will be able to use the program.
Drawback of CGI:
One of the drawbacks of using CGI is that each time a CGI script is executed, a new process is started.For busy Web sites, this can slow down the server noticeably. An efficient and popular solution to this problem is to use java servlets.
Many of the functionality of CGI can be duplicated by newer technology such as JavaScript and ActiveX.
Benifit of using CGI over these technologies:
As Java, JavaScript, and ActiveX can all be turned off within the browser, besides that many company firewalls disallow these technologies to work in their system (often for security or bandwidth reasons). But as CGI scripts are run on the external Web server, they are not limited by browser or firewall limitations. Therefore by using CGI rather than browser based scripting , you can be sure that all of your readers (with very few exceptions) will be able to use the program.
Drawback of CGI:
One of the drawbacks of using CGI is that each time a CGI script is executed, a new process is started.For busy Web sites, this can slow down the server noticeably. An efficient and popular solution to this problem is to use java servlets.