0
我正在學習Python的,,所以我得到了這個運動從一本書: 這是一個html形式:蟒蛇在線形式(例如反饋)不能正常工作
<html>
<body>
<form method=POST action="cgi-bin/cgi101.py">
<P><b>Enter your name:</b>
<P><input type="text name=user" />
<P><input type="submit" />
</form>
</body>
</html>
這是腳本調用:
#!/usr/bin/python3
import cgi
form = cgi.FieldStorage()
# parse form data
print('Content-type: text/html\n')
# hdr plus blank line
print('<title>Reply Page</title>')
# html reply page
if not 'user' in form:
print('<h1>Who are you?</h1>')
else:
print('<h1>Hello <i>%s</i>!</h1>' % cgi.escape(form['user'].value))
通過,如果我輸入用戶的邏輯,必須打印
史詩般的失敗......感冒後我不應再編碼......謝謝! – boldnik