View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > CGI

From LQWiki

Jump to: navigation, search

CGI stands for Common Gateway Interface.

Normally, when you request a web page from a web server, the server sends you back the static HTML page you asked for. Generally, if you request a CGI script (usually a Perl script) instead of an HTML page, the web server will execute the script and send you its output, usually in the form of HTML. In other words, with CGI the work is done server-side, as opposed to the work being done by the browser, as it is in the case of JavaScript.

Any executable program or script can be used as a CGI script. It doesn't have to be Perl. Another very common CGI scripting language is PHP, but its possible to use anything, including shell script, C programs, Python or any other language capable of reading environment variables and writing HTTP headers to stdout.

External links


Personal tools