|
Introduction to CGI.
 |
To understand what CGI (Common Gateway Interface) programs do, it's first useful to review what a Web Server itself does. Web pages are simply HTML files that are stored on the Web Server's disk drive. When a request arrives for a web page, the Web Server gets the page from the disk and sends it over the internet to the user. Notice that normally the Web Server doesn't actually DO anything to the page at all, other than sending it.
We saw one exception to this in the previous section with SSI, where the Web Server itself replaces something on the page before it is sent.
Unlike an SSI command, a CGI is usually a completely separate computer program, usually running on the same computer as the Web Server program. Because a CGI is a separate program, it could be programmed to do anything at all. |
|
|
So what are CGI's?
|
CGI's are separate computer programs that run along side a web server. They are usually small programs designed to perform some specific task, usually to expand the capabilities of a web site. Remember, CGI's are not part of a web page (like SSI). They operate along-side or behind-the-scenes.
|
|
What are CGI's
commonly used for? |
If you have used the World Wide Web very much at all, you will have come across web pages that ask you to fill-in forms, to provide information such as your name, address, email address and etc. HTML itself can create these forms and collect the information on the page, but HTML cannot actually DO anything with the information it collects. It can't even save it.
The information collected on web pages must be given to a CGI application so something can be done with it. The CGI might save the information in a file, it might check the validity of a credit card number, it might send an email, or any number of things.
If you have used web pages on the internet that collect information, you have used CGI applications. |
|
| Sample CGI |
Click on the "Sample CGI" link to the right to see a CGI in action. After you're done viewing the CGI generated page, Click on your browsers "Back" button. |
CGI coming soon. |
|
What else can you do
with a CGI program? |
Anything. At least anything you can program a computer to do. If you've used an internet search engine you've been seeing CGI's in action. When you type in search words, the CGI takes over and sends the information to another computer to be looked-up in a large database. Then it creates a special web page on-the-fly, just for you, and gives that new page back to the web server to send on to you.
If you can program a computer to do something, you can program a CGI to do it and hook it up to the web. |
|
How do you write
a CGI program? |
That is way too big a topic for this introduction. CGI's can be written in any number of computer scripting or programming languages. It is not a trivial matter to write a substantial CGI. It is like writing any other computer program. But many CGI's that perform commonly needed functions are readily available.
Like any other computer program, a CGI must be written for the specific computer platform on which it is to run, Unix/Linux, Macintosh, or Windows.
To see what the Lorian Network offers in terms of CGI's, see our Support section. |
|
ADDING SSI |
ADDING MULTIMEDIA |
|
|