100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > html数据提交到python 将html页面数据发送到python flask variab

html数据提交到python 将html页面数据发送到python flask variab

时间:2023-11-01 23:40:13

相关推荐

html数据提交到python 将html页面数据发送到python flask variab

我知道这个问题已经问了很多次了,但是这些答案对我没有帮助,请原谅我再次问。在

我正在获取表格中的数据索引.html页面并在下一个html页面中显示(annodisplay.html)供用户查看,然后单击“提交”。

我希望只在用户按下submit按钮时将数据传递给python变量。但是我没有得到python变量中的形式值。在

这是我的python烧瓶代码。在app = Flask(__name__)

@app.route('/send', methods=['GET', 'POST'])

def send():

if request.method == 'POST':

affflash = request.form['affflash']

return render_template('annodisplay.html', affflash=affflash)

return render_template('index.html')

@app.route('/get', methods=['GET', 'POST'])

def get():

if request.method == 'POST':

return render_template('submit.html')

return render_template('annodisplay.html')

affflash = request.form['affflash']

print affflash

if __name__ == "__main__":

app.run(debug=True)

这是我的HTML索引.html代码

^{pr2}$

这是我的annodisplay.html代码

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。