getmonth.psp模板文件
<title>输入一个日期</title>
<body>
<form method="POST" name="form" action="http://192.168.1.91/py/getmonth.py">
<p>
<hr>
<br />
输入一个日期 2011年: <br />
<INPUT type="text" name="month" value="2011-4-20">
<br />
<input type="submit" value="提交">
</form>
</body>
getmonth.py文件:接收POST过来的字段
from mod_python import apache,util
def index(req):
#第一种getfirst获取值方法
#form = req.form.getfirst('month')
#return "日期: %s "%form
#第二种form获取值方法
return "日期: %s "%req.form['month']
这都是在Apache配置纯python环境下的应用
参考:http://ghantoos.org/howto-apache2-mod_python/