1. Install python; 2. Configure IIS: a. Open Administrative Tools -> Internet Information Services; b. Right-click on the website properties, enter the property settings; c. Go to the home directory page, enter the application configuration; d. Add a mapping: Executable File Write: C: /python23/python.exe "% s"% s Note Pythong path To point to the location where you install Python, pay attention to the space between parameters. Extended: .py Action Limits to: GET, HEAD, POST E. Select the script engine, select whether the check file is existing; f. All the way is determined to complete the configuration. 3. Write CGI scripts:
Import CGI # Pour to CGI Module Print 'CONTENT-TYPE: TEXT / HTML' # must, Output HTML Document Head Print # Blank Line Marking End of Http Headers # must, the document head must end with blank line cgiParameters = cgi.fieldStorage () #Get the parameter set of POST or GET # Check if it is the parameter IF not (cgiparameters.has_key ("name") and cgiparameters.has_key ("address)): # If it is not output Form, ask for fill in Name and Address Print "