Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cur.execute("SELECT COUNT(*) FROM users WHERE username = ? AND password = ?", (request.form['username'], request.form['password']))
- data = cur.fetchone()[0]
- # If given username and password returns a row, create the session
- if data == 0:
- return redirect(url_for('index'))
- else:
- session['username'] = request.form['username']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement