• HTML from表单的name属性


    # web应用程序
    import socket

    sock=socket.socket()
    sock.bind(("127.0.0.1",8787))
    sock.listen(5)

    while 1:
    print("server is working...")
    conn,addr=sock.accept()
    #接受请求数据
    recv_data=conn.recv(1024)
    print("recv_data\n",recv_data.decode())
    with open("index.html","rb") as f:
    data =f.read()
    conn.send(b"HTTP/1.1 200 OK\r\n\r\n" + data)
    conn.close()
    sock.close()
    <h1>hi huchangxi</h1>
    <img src="https://imgcps.jd.com/ling4/100026667910/5Lqs6YCJ5aW96LSn/5L2g5YC85b6X5oul5pyJ/p-5f3a47329785549f6bc7a6f5/15fd9fad/cr/s/q.jpg">
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Title</title>
    </head>
    <body>
    <h3>注册页面</h3>
    <form action="http://127.0.0.1:8787" method="post">
    <p>姓名 <input type="text" name="user" value="root"></p>
    <p>密码 <input type="password" name="pwd" value="123456"></p>
    <p><input type="submit"></p>
    </form>
    </body>
    </html>

     

     

     

  • 相关阅读:
    USACO Spinning Wheels
    USACO Agri-Net
    NOIP 2009 最优贸易
    USACO Cow Contest
    USACO Subset Sums
    USACO Cow Cars
    USACO Making the Grade
    NOIP 2008 传纸条
    NOIP 2000 方格取数
    NOIP 1999 导弹拦截
  • 原文地址:https://www.cnblogs.com/A121/p/16290038.html
Copyright © 2020-2023  润新知