python怎么接收表单的POST值
1个回答
展开全部
__author__ = 'Administrator'
#encoding:utf8
print """
<html>
<head>
</head>
<body>
<form action='form.py' method='post'>
<input type='text' name='name' />
<input type='submit' value='提交' />
</form>
</body>
</html>
"""
__author__ = 'Administrator'
import cgi
form = cgi.FieldStorage()
if form.has_key('name'):
code = form['name'].value
print code
#encoding:utf8
print """
<html>
<head>
</head>
<body>
<form action='form.py' method='post'>
<input type='text' name='name' />
<input type='submit' value='提交' />
</form>
</body>
</html>
"""
__author__ = 'Administrator'
import cgi
form = cgi.FieldStorage()
if form.has_key('name'):
code = form['name'].value
print code
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询