How To Delete Uploaded Picture From A Folder

free web hosting
Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

How To Delete Uploaded Picture From A Folder

itssami
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

Reply

rvalkass
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.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : delete uploaded folder

  1. Delete Problem With Id - Id as auto_increment, and identifier for a row (4)
  2. How To Delete A Row In Mysql. - A very simple help required (4)
    Im using the following code, for very simple work.. it simply gets and print the comments which are
    stored in the database. Now it will show like comment 1. comment 2. comment 3. etc etc i want to
    add 'delete' option that i can delete any comment. it displays like comment 1.
    Delete comment 2. Delete comment 3. Delete
    So that when i click on delete, it simply deletes the comment and print the remaining comments. Its
    very simple. i hope you understand. QUOTE $result = mysql_query("sele...
  3. File String Delete? - (2)
    Say i have a file file.txt... Can someone give me an example of how to delete a string from this
    file ie.. The file contains: wappy::sucks::at::php --- i want to delete sucks::...
  4. How To Access A Folder In Php Page - (1)
    I have a folder on my hosting space..(i.e. public_html), i want to add this folder on my php page..,
    . how it should be done that, when i add some file in the folder using ftp or anything , the folder
    on that page automatically includes that file.for example , if the folder has 5 files..and on page
    it says "folder has 5 files" and shows the files...and when i have uploaded 2 more files ,it should
    automatically say that folder has 7 files.. ...



Looking for delete, uploaded, picture, folder

Searching Video's for delete, uploaded, picture, folder
advertisement



How To Delete Uploaded Picture From A Folder



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE