Jun-11-2020, 06:50 AM
(This post was last modified: Jun-11-2020, 07:08 AM by card51shor.)
https://www.spiderposts.com/2019/07/04/f...th-python/
I had it print out the username and it's correct.
I guess it's adding single quotes and a comma to the usernamedata and passworddata any idea how i can get rid of those?
@app.route("/login", methods=["GET","POST"]) def login(): password = request.form.get("password") username = request.form.get("username") usernamedata = db.execute("SELECT username FROM users WHERE username=:username", {"username":username}).fetchone() passworddata = db.execute("SELECT password FROM users WHERE username=:username", {"username":username}).fetchone() if username == usernamedata and password == passworddata: return render_template("welcome.html") else: return render_template("login.html") @app.route("/home") def home(): return render_template("home.html")OK now I got this code and it's not giving me any errors. But it's not matching the username and password? It always goes to render login.html even when i type in a correct user and password.
I had it print out the username and it's correct.
I guess it's adding single quotes and a comma to the usernamedata and passworddata any idea how i can get rid of those?