To whoever downvoted my question because they saw there were related answers. The only related question/answers I saw was about redirecting to a full URL. I want to know how to redirect to another function so I can pass a parameter. PLEASE re-read my issue before jumping to conclusions.
My problem: If the user is directed to /userLogoutGo, I'd like that function to pass the message you see on to the index function and have that function open its template. Please help me see what I'm doing wrong? Thanks!
from flask import Flask, request, render_template, redirect, url_for, session
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
@app.route('/userLogin', methods=['GET', 'POST'])
def index(myParam=''):
if myParam != '':
t_message = myParam
else:
t_message = "Login or Register"
return render_template("user_register.html",
t_message=t_message,
t_js="user_register.js",
t_title=t_message,
id_user=id_user)
@app.route('/userLogoutGo', methods=['GET', 'POST'])
def userLogoutGo():
global id_user
id_user = 0
a = index("Logged out. Now you can Log In or Register")