|
|
||||||||||
|
|
Advanced Methods | CGI Scripts |
|
|
|
||||||
|
CGI Scripts
When you attempt to view a Web page with your browser, the browser sends a request to the machine that holds the file for the page you are requesting. If that machine finds the file (and there are no problems such as your being restricted from accessing the file), the machine sends, or "serves", a copy of the file to your browser. For this reason the software that provides a copy of the file to you is called a "server". (The browser, which requests the file from the server, is an example of a "client program"; there are many other types of client programs besides browsers.)
CGI Scripts Produce Dynamic Documents
If you link such a program to a Web page, you can execute the program by simply clicking on the link, just as you can go to another page or display an external image by clicking on a link to it. For example, click here to display the current date and time. Since the time is changing continuously, it is clear that clicking on this link did more than just access a static file on a server; something on the server looked up the date and time and sent it back to us. In this case, that something was a very simple CGI script.
The Power and Limitation of CGI Scripts
So there are a number of ways such programs can transform a page from just a document to be read into a dynamic display or a useful tool. We'll look at some specific examples of CGI programs in action, and we'll show you one that you can use to perform simple processing of user input. But before you become too excited by the possibilities, we have to admit, unfortunately, that there are reasons why instruction in the creation of such programs is beyond the scope of this Tutorial.
|
||||||||||
|
|
||||||||||