What Is It?
"Common Gateway Interface," allows Web programs interact dynamically with users. Many search boxes and other applications that result in a page with content tailored to the user's search terms rely on CGI to process the data once it's submitted, to pass it to a background program in JAVA, JAVASCRIPT, or another programming language, and then to integrate the response into a display using HTML.

How Does It Work?
1) Your browser requests a web page containing CGI or PERL from the Web Server.
2) The Web Server sends any CGI or PERL requests to the CGI application on the server.
3) The CGI application processes the request and returns HTML Code to the Web Server.
4) The Web Server sends the final HTML code to your web browser.