Jump to content
xisto Community
Sign in to follow this  
itssami

How To Delete Uploaded Picture From A Folder

Recommended Posts

i wrote some code to upload the pictures to a folder and after it has uploaded, there's a page, say pics.php.. it displays all pictures of the folder to that page. now i want to add an option to delete the pictures. for example i want to add a link "Delete" under every pic, that when i click it deletes the pic from the folder and deletes the pic data from mysql.How i can delete the pic from the folder? thanks

Share this post


Link to post
Share on other sites

The unlink function is what you need to delete files. You presumably have the path to each image (if you are displaying them on the screen), so you can add that path to a link that runs the unlink function. You can read a little bit more about it here. Just be careful with it, and make sure the permissions allow you to delete the file.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.