Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="" method="POST" ><button class="btn btn-danger" type="submit" name="delete" value="{{ item2 }}"><span class="glyphicon glyphicon-trash"></span> Delete</button> </form>
- @app.route('/', methods=["GET","POST"])
- def home():
- if request.method == 'POST':
- if request.form['delete'] == post_id:
- sql = "DELETE FROM test_table WHERE post_id = " + post_id +";"
- c.execute(sql)
- return redirect("/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement