发布网友 发布时间:2022-04-24 01:41
共1个回答
热心网友 时间:2022-04-18 06:22
from flask import Flask
from flask import request
app = Flask(__name__)
@app.route('/')
def index():
"""
前端
"""
return """
<form action="/main">
<div class="item">
<input type="text" name="number" maxlength="11" placeholder="请输入您的手机号" autocomplete="off" class="name">
</div>
<div class="submit"><button>提交</button></div>
</form>
"""
@app.route('/main')
def main():
"""
接收表单信息
"""
data = request.values.get('number')
.get('number')里的number是前端input标签里name的属性