cgi — Common Gateway Interface support — Python 3.10.21 documentation

docs.python.org

Tin mới

audioop — Manipulate raw audio data

cgitb — Traceback manager for CGI scripts

Python Module Index

3.10.21 Documentation

The Python Standard Library

Superseded Modules

Using the cgi module¶

When you write a new script, consider adding these lines:

Using the cgi module¶

When you write a new script, consider adding these lines:

Using the cgi module¶

When you write a new script, consider adding these lines:

Using the cgi module¶

When you write a new script, consider adding these lines:

Using the cgi module¶

When you write a new script, consider adding these lines:

Higher Level Interface¶

The previous section explains how to read CGI form data using the FieldStorage class. This section describes a higher level interface which was added to this class to allow one to do it in a more readable and intuitive w

urllib.parse.parse_qs()

Parse a query in the environment or from a file (the file defaults to sys.stdin). The keep_blank_values, strict_parsing and separator parameters are passed to urllib.parse.parse_qs() unchanged.

Caring about security¶

To be on the safe side, if you must pass a string gotten from a form to a shell command, you should make sure the string contains only alphanumeric characters, dashes, underscores, and periods.

Installing your CGI script on a Unix system¶

Read the documentation for your HTTP server and check with your local system administrator to find the directory where CGI scripts should be installed; usually this is in a directory cgi-bin in the server tree.

test: Regression tests package containing the testing suite for Python.

The next step could be to call the cgi module’s test() function from your script: replace its main code with the single statement