I am using codeigniter to create the admin panel of my website. I am not using it for the front end because I have lots of static pages in the front end and only a few things need to be dynamic so I will be doing it with core PHP queries.
My link for unlinking photo is , images is the controller and unlinkPhoto is the function and 32 is the image ID.
localhost/admin/index.php/images/unlinkPhoto/32
EDIT
however my image is located at localhost/uploads/testimage.jpg.
How can I point to that folder to unlink the image in codeigniter.
You really need to make sure you’re enforcing decent security protocols, otherwise anyone can fake the GET request and delete the entirety of your uploaded files. Here is a basic solution:
If you’re using PHP 5.4, you might be able to reduce this code down even more:
Because they’ve implemented array dereferencing (finally). Although I haven’t tested this particular piece of code. This is just a geeky addendum.