php - Deleting database records MVC -
i've built mvc 'framework' learning purposes, , i'm struggling problem:
i working on crud application , don't know how should delete records database. right i'am doing through url.
example.com/controller/delete/id
how delete record database. don't way, because unintentionally or intentionally delete database records.
so question is: how should implement feature?
you've got number of issues here:
first of all, need know performing operation, need decide if they're allowed it.
for first, need login system issues session id client (usually via cookie). use session id on server user , check if they're allowed delete. handled through granting roles users , allowing roles perform actions
incidentally, get
requests used requests not modify server state , can repeated no side-effects. post
, (or put
/delete
) should used action makes changes. browsers not send post twice without prompting user explicitly.
Comments
Post a Comment