我目前有一个表单,当它提交时,它使用所有必需的参数进行重定向(见下文),
我的问题是,当它从表单页面重定向到结果页面时,如果我刷新结果页面,它会重新运行逻辑,并且我希望用户在看到新结果之前必须再次输入表单信息.
JavaScript重定向:
document.location.href = "/results?age=" + encodeURIComponent(userage) + "&price=" + encodeURIComponent(price);
Python逻辑:
@application.route("/results")
def get_response():
age = request.args.get("age")
price = request.args.get("price")
htmltext = age+price
return render_template("results.html",html=str(htmltext))