|
|
|
|
![]() ![]() |
Mar 5 2007, 05:00 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 258 Joined: 13-November 05 Member No.: 14,234 |
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 |
|
|
|
Mar 5 2007, 08:25 PM
Post
#2
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,056 Joined: 28-May 05 From: Hertfordshire, England Member No.: 7,593 ![]() |
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.
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 27th July 2008 - 01:07 AM |