Stock trading strategy ebook15 comments
Swiss binary options brokers no deposit bonus 2016
In computing , Common Gateway Interface CGI offers a standard protocol for web servers to execute programs that execute like Console applications also called Command-line interface programs running on a server that generates web pages dynamically.
The specifics of how the script is executed by the server are determined by the server. In the National Center for Supercomputing Applications NCSA team wrote the specification for calling command line executables on the www-talk mailing list. Specifically mentioned in the RFC are the following contributors: Historically CGI scripts were often written using the C language.
Each web server runs HTTP server software, which responds to requests from web browsers. Generally, the HTTP server has a directory folder , which is designated as a document collection — files that can be sent to Web browsers connected to this server. For pages constructed on the fly, the server software may defer requests to separate programs and relay the results to the requesting client usually, a web browser that displays the page to the end user. In the early days of the web, such programs were usually small and written in a scripting language; hence, they were known as scripts.
Such programs usually require some additional information to be specified with the request. For instance, if Wikipedia were implemented as a script, one thing the script would need to know is whether the user is logged in and, if logged in, under which name.
The content at the top of a Wikipedia page depends on this information. HTTP provides ways for browsers to pass such information to the web server, e. The server software must then pass this information through to the script somehow. Conversely, upon returning, the script must provide all the information required by HTTP for a response to the request: Initially, different server software would use different ways to exchange this information with scripts.
As a result, it wasn't possible to write scripts that would work unmodified for different server software, even though the information being exchanged was the same. Therefore, it was decided to establish a standard way for exchanging this information: CGI the Common Gateway Interface , as it defines a common way for server software to interface with scripts. Webpage generating programs invoked by server software that operate according to the CGI standard are known as CGI scripts.
This standard was quickly adopted and is still supported by all well-known server software, such as Apache , IIS , and with an extension node. An early use of CGI scripts was to process forms.
When the submit button is pushed the URI specified in the "action" attribute would be sent to the server with the data from the form sent as a query string.
This is usually done by marking a directory within the document collection as containing CGI scripts — its name is often cgi-bin. That is, anything that the script sends to standard output is passed to the Web client instead of being shown on-screen in a terminal window. As remarked above, the CGI standard defines how additional information passed with the request is passed to the script. The script can then read these environment variables or data from standard input and adapt to the Web browser's request.
The following Perl program shows all the environment variables passed by the Web server:. If a Web browser issues a request for the environment variables at http: Some, but not all, of these variables are defined by the CGI standard. The program could then generate any content, write that to standard output , and the Web server will transmit it to the browser.
The following are environment variables passed to CGI programs:. The program returns the result to the Web server in the form of standard output, beginning with a header and a blank line. Another popular convention is to use filename extensions ; for instance, if CGI scripts are consistently given the extension. While convenient, and required by many prepackaged scripts, it opens the server to attack if a remote user can upload executable code with the proper extension.
The Web server creates a subset of the environment variables passed to it and adds details pertinent to the HTTP environment. CGI is often used to process inputs information from the user and produce the appropriate output. An example of a CGI program is one implementing a Wiki. The user agent requests the name of an entry; the Web server executes the CGI; the CGI program retrieves the source of that entry's page if one exists , transforms it into HTML , and prints the result.
The web server receives the input from the CGI and transmits it to the user agent. If the "Edit this page" link is clicked, the CGI populates an HTML textarea or other editing control with the page's contents, and saves it back to the server when the user submits the form in it. Calling a command generally means the invocation of a newly created process on the server. Starting the process can consume much more time and memory than the actual work of generating the output, especially when the program still needs to be interpreted or compiled.
If the command is called often, the resulting workload can quickly overwhelm the server. Another way to reduce the overhead is to use precompiled CGI programs, e. The optimal configuration for any Web application depends on application-specific details, amount of traffic, and complexity of the transaction; these tradeoffs need to be analyzed to determine the best implementation for a given task and time budget.
From Wikipedia, the free encyclopedia. This article is about the software interface between a web server and programs. For other uses, see CGI disambiguation. Common Gateway Interface at w3. Archived from the original on Retrieved from " https: Servers computing Web 1.