I have a basic web application. I'm connected to the database. There's a lot of users in the database.
In my site, there is ability to add articles. I want an article to be edit-able just if it's mine. And I have a button that when it's clicked, article can be edited. I want that button to be shown near the article which is created by me. I don't want my article to be edit-able by another user. But I don't know how to do it. Should I start sessions or store something in variables or something?
And could anyone tell me how can I edit all articles if I'm an admin?. When admin is logged, I'm creating a session $_SESSION['admin'];
Any suggestions will be greatly appreciated.
Thanks.