![[CGI Examples]](cgi.gif)
CGI's (Common Gateway Interfaces) allows users to create complete HTML documents on the fly. This can be useful if the information presented in the document changes frequently, the information presented is based on the contents of another file (e.g. a database), the layout is highly repetitive and can be more easily automated, the page needs to perform an action based on the clients activity or responses (e.g. read information from a form and e-mail the results to another person). There are many reasons to use CGI's.
Unlike SSI's though, these programs must define the entire HTML document, not just a portion of it.
A useful sources of information about CGI's can be found on the Guidelines page.
CGI's are either defined in an <HREF> like and ordinary HTML file, or the are passed as the argument in a <FORM> tag. Normally a CGI called from a <HREF> will not pass any arguments. This means the client won't influence the appearance on content of the referenced page. If carefully constructed though, arguments can be passed, and this can be useful. If the client needs to supply information, this is usually done with a <FORM>, and one the the arguments in a <FORM> statement is the CGI program (referenced by URL address, not filesystem name) which will process the data. The data in the <FORM> will be passed to the CGI as command line arguments.