PHP can use $_post receive. I don’t know how Python receive
__author__ = 'Administrator'
import cgi
form = cgi.FieldStorage()
if form.has_key('name'):
code = form['name'].value
print code
lxj-PC - - [11/Sep/2012 20:09:55] "POST /cgi-bin/form.py HTTP/1.1" 200 -
lxj-PC - - [11/Sep/2012 20:09:55] command: C:\Python27\python.exe -u D:\python\a
pp\cgi-bin\form.py ""
lxj-PC - - [11/Sep/2012 20:09:55] CGI script exited OK
lxj-PC - - [11/Sep/2012 20:09:55] code 404, message File not found
lxj-PC - - [11/Sep/2012 20:09:55] "GET /favicon.ico HTTP/1.1" 404 -
Why can not print out the value of it? Page Output gaps
Use
FieldStorage()from thecgimodule, but keep in mind that the entire PHP language essentially is a web framework, and you’re going to find things in Python a lot more difficult if you have the attitude “I can do this in PHP easily without using any framework so I should use Python with no framework.” A WSGI micro-framework will make your life much easier.