What is CGI?
CGI is a simple protocol for generating dynamic web pages.
How does it work?
If I can simplify things a little bit, basically, CGI works like this:
- The web browser sends a request to the web server.
- The web server determines that the request is for a CGI program (and not a static web page).
- The web server executes the CGI program (passing it information about the request from the web browser).
- The CGI program processes the request and generates a response (usually this response is the dynamic web page).
- The web server captures the response from the CGI application, and sends that response back to the web browser.
That's It!
Well, that's almost it, a few questions need to be answered, like:
- How does the web server know that a request is for a CGI program (and not a static web page)?
- What kinds of information about the request, does the web server pass to the CGI program (and how is this information passed)?
- How does the web server capture the response from the CGI program?
You can find out the answers to those questions (and more) at: