#!D:\Python27\python2.exe
import cgi
form = cgi.FieldStorage()
name = form.getvalue('name', 'world')
print """Content-type: text/html
<html>
<head>
<title>Greeting Page</title>
</head>
<body>
<h1>Hello, %s!</h1>
<form action='simple3.cgi'>
Change name <input type='text' name='name' />
<input type='submit' />
</form>
</body>
</html>
""" % name
代码如上,在浏览器中可以正常打开,但是在文本框中输入新字段之后,并没有改变成对应的'Hello,name',而是显示404 NOT FOUND:
Not FoundThe requested URL /cgi-bin/simple3.cgi was not found on this server.
但是奇怪的是直接在url后面添加?name=somename之后却能正常运行;
请问各位大神这到底是哪里出了问题?
|