目录结构 webserver.py 为main文件,当前目录为html根目录,cgi-bin目录为python处理文件目录

python HTTPServer模块写web

python HTTPServer模块写web


webserver.py文件内容

python HTTPServer模块写web


greeting.html文件内容

python HTTPServer模块写web


greeting.py文件内容

python HTTPServer模块写web


流程解释:

client 请求greeting.html文件拿到页面

python HTTPServer模块写web



填写内容提交表单由cgi-bin目录下greeting.py文件处理并相应内容

python HTTPServer模块写web


注:greeting.html文件中form表单提交方法POST和GET区别

POST方法提交后

python HTTPServer模块写web

GET方法提交后

python HTTPServer模块写web




相关文章:

  • 2021-10-17
  • 2021-12-18
  • 2021-07-28
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-05-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2021-06-11
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案