【发布时间】:2015-06-11 23:07:10
【问题描述】:
我有文件 test.py:
import cgi, cgitb # Import modules for CGI handling
form = cgi.FieldStorage()
person_name = form.getvalue('person_name')
print ("Content-type:text/html\n\n")
print ("<html>")
print ("<head>")
print ("</head>")
print ("<body>")
print (" hello world <br/>")
print(person_name)
print ("</body>")
print ("</html>")
当我访问 www.myexample.com/test.py?person_name=john 时,我得到的结果是:
你好世界
没有
意味着我无法从 url 中获取参数“person_name”。
附言它在我的本地主机服务器中完美运行,但是当将其上传到在线网络服务器时,为什么无法解析来自 url 的参数。
我该如何解决?
【问题讨论】:
标签: python python-3.x cgi