CGI is an abbreviation for 'Common Gateway Interface'. CGI adds a lot of interactivity to your web site.
Common Gateway Interface specifies a set of standards how a web user can run programs that are located on a web server from their computer, how a web server communicates with the software program(CGI program) that resides on it and how this software talks back to the web server. Any kind of software can be a CGI program if it handles input and output according to CGI standards.
CGI scripts are commonly written in a programming language called Perl (Practical Extraction and Reporting Language). But can also be written in C+, C++, Java, Visualbasic etc.
Why PERL?
Perl programs are easy to write and simple to understand.C/C++ requires a skilled programmer and lot of patience to create a successful application.
Perl has its roots deep on the Unix servers and every webserver has Perl Interpreter installed on it.
Perl handles strings very efficiently so can be used to process data from forms and other input.
Why cgi?
Java scripts can only work on the client side.That means the scripts run in the browser of the user. Where as cgi script resides on the server and interact directly with the server. So they are on the server side.
You have full control of your cgi scripts because they reside on your server.
Cgi scripts need to interact with other files like a send mail program. But java scripts don't need to interact with your files. Java scripts are simply inserted
into the html pages, so they can work with a browser.
Java scripts can't be executed in java disabled browsers. But cgi programs can run with any browser.
|