February 2006
Intermediate to advanced
648 pages
14h 53m
English
The cgi module is used to implement CGI scripts in web applications. CGI scripts are programs executed by a web server when it wants to process user input submitted through an HTML form such as the following:
<FORM ACTION=' /cgi-bin/foo.cgi' METHOD= 'GET' > Your name : <INPUT type= 'Text' name= 'name' size= '30' > Your email address: <INPUT type= 'Text' name= 'email' size= '30' > <INPUT type= 'Submit' name= 'submit-button' value= 'Subscribe' > </FORM>
When the form is submitted, the web server executes the CGI program foo.cgi. CGI programs receive input from two sources: sys.stdin and environment variables set by the server. The following list details common environment variables set by web servers:
| Variable | Description |
|---|---|
| AUTH_TYPE | Authentication ... |
Read now
Unlock full access