Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <form action="" method="POST" ><button class="btn btn-danger" type="submit" name="delete" value="{{ item2 }}"><span class="glyphicon glyphicon-trash"></span> Delete</button> </form>
  2.  
  3. @app.route('/', methods=["GET","POST"])
  4. def home():
  5. if request.method == 'POST':
  6. if request.form['delete'] == post_id:
  7. sql = "DELETE FROM test_table WHERE post_id = " + post_id +";"
  8. c.execute(sql)
  9. return redirect("/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement