CGI: A program running on a server that provides an interface to the client's HTML. (Common Gateway Interface Universal Gateways Interface)
CGI is not restricted to use language.
How CGI works:
First the browser accesses the URL and connects to the server, and the Web server receives the request information, resolves the URL, finds whether the file accessed exists on the server, returns the contents of the file if it exists, or returns an error message. The browser receives the information from the server and displays the accepted file or the error message received.
cons : Each time the CGI request is searched to generate a copy of the program to run.
Improved : fastcgi first compile, mod_perl the interpreter as a module in the Web server, use the C compiler language.
Environment variables for CGI:
Content_Type
Http_cookie
Remode_addr
Request_method (scripts are called methods, such as EGT and post)
Get method and Post method
Python comes with a Web server
Apache
First CGI program (four Steps):
Create a Directory
Writing CGI Programs
Turn on the server
Access using a browser
The CGI of Python