使用GET提交form

来源:互联网 发布:ubuntu新建文件夹 编辑:程序博客网 时间:2024/06/05 09:09
#!D:\ProgramFiles\Python27\python# Import modules for CGI handling import cgi, cgitb # 创建 FieldStorageform = cgi.FieldStorage() # 从字段中获取数据name = form.getvalue('name')age  = form.getvalue('age')#设置头文件print "Content-type:text/html\r\n\r\n"# 数据html Bodyprint "<html>"print "<head>"print "<title>Welcome to python CGI</title>"print "</head>"print "<body>"print "<h2>Hello %s %s</h2>" % (name, age)print "</body>"print "</html>"

 

记得去除中文

 


0 0
原创粉丝点击