Click a link, Delete a File
Moderator: General Moderators
Click a link, Delete a File
I would like to be able to click a link that's automatically generated for me, and have it delete a file. The link would probably call a php page that would feed the filename into a function I'm assuming. What kind of function would I need to create to do that?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
create a list of files using opendir() and readdir(). Then pass the filename as a $_GET parameter along withfile_exists() to make sure the file exists before using unlink() to delete the file