mini-httpd的配置文件里还是允许所有文件类型: cgipat=cgi-bin/**,建立下面的文件: 123456789101112131415 import cgiprint "Content-type:text/htmlrnrn"print "<html>"print "<head><title> My first CGI </title></head>"print "<body>"print "<p> OK Done </p>"print "</body>"print "</html>"form = cgi.FieldStorage()if form.getvalue("name"): print '<h2> Hello ' + form.getvalue("name") +" ! </h2> " 放到cgi-bin里,注意要有可执行权限,结果运行如下: 赞微海报分享
近期评论