Showing posts with label CGI. Show all posts
Showing posts with label CGI. Show all posts

Friday 18 April 2014

CGI or Common Gateway Interface:

CGI or Common Gateway Interface:
To understand the concept of CGI, let's see what happens when we click a hyperlink to browse a particular web page or URL.

    Your browser contacts the HTTP web server and demand for the URL ie. filename.

    Web Server will parse the URL and will look for the filename. If it finds requested file then web server sends that file back to the browser otherwise sends an error message indicating that you have requested a wrong file.

    Web browser takes response from web server and displays either the received file or error message based on the received response.

However, it is possible to set up the HTTP server in such a way that whenever a file in a certain directory is requested, that file is not sent back; instead it is executed as a program, and produced output from the program is sent back to your browser to display.

The Common Gateway Interface (CGI) is a standard protocol for enabling applications (called CGI programs or CGI scripts) to interact with Web servers and with clients. These CGI programs can be written in Python, PERL, Shell, C or C++ etc.