javascript - Deleting comments -
i storing comments in mysql comment id each of them (auto increment) , when retrive them , show users store each comments comment_id in hidden input..so when user wants delete comment need have id of comment if body changes value through javascript edit.? , sends server ..other comments might deleted right...becoz commnet_id being auto incremented values like...1,2.3....i suppose..how done usually..?
you validate whether logged in user has permission delete given comment in back-end. if gave user permission it, doesn't matter how sent request it.
for example, if users allowed delete own comments, check if commenter_id same logged in user's id before executing delete
query.
Comments
Post a Comment