A CGI script is any program that runs on a web server.
Why CGI Scripts
CGI stands for Common Gateway Interface
CGI defines a standard way in which information may be passed to and from the browser and server.
Any program or script that can process information according to the CGI specification can, in theory, be used to code a CGI script.