Proper way of deleting records with Codeigniter
Posted
by
luckytaxi
on Stack Overflow
See other posts from Stack Overflow
or by luckytaxi
Published on 2011-01-18T01:30:20Z
Indexed on
2011/01/18
1:53 UTC
Read the original article
Hit count: 573
codeigniter
I came across another Stackoverflow post regarding Get vs Post and it made me think. With CI, my URL for deleting a record is http://domain.com/item/delete/100, which deletes record id 100 from my DB. The record_id is pulled via $this->uri->segment
. In my model I do have a where clause that checks that the user is indeed the owner of that record. A user_id is stored in a session inside the DB. Is that good enough?
My understanding is, POST should be used for one time modification for data and GET is for retrieving regards (e.g. viewing an item or permalink).
© Stack Overflow or respective owner