CGI programs permit the Web surfer to perform actions affecting the state of things on the Web server. In many cases, the Web server machine is also where the neat stuff lives, so that the CGI script has direct access to files, processes, and databases to fully respond to a request. But sometimes the request needs to be shipped off from the machine that's supposed to handle the CGI query to a machine that can actually handle the query. For example, if you rent space on a virtual server to handle your customers' page-fetching activities, and also have CGI scripts to let them ask questions or order products, it's possible that the order-entry system actually lives at another machine not directly accessible to the CGI scripts.
展开▼