i'm trying to learn how to delete files from my server via php. the idea would be to browse to a page w/ user agent as Firefox or IE, etc, and view a list of files in the specified directory-- these files are already displayed using a glob() function. i just want to be able to pick one of those files and delete it from the server.
i would imagine that this poses a security risk, but again-- this is going on a private site where i'd hope not to receive uninvited visitors. hmmm...
i don't mean to discount the importance of security-- i guess i'm just trying to "get too much done" w/out pausing for considering how to handle security-- sigh-- well, let me at least ask:
if i want to use stream_wrapper_register() and unlink() together for the purpose of deleting a file from a specified directory, how might i go about doing it? i understand that i need to "...define a class with a number of member functions..." (php.net) so that is my first obstacle as i haven't done anything w/ classes yet really.
i appreciate any advice/ help you can offer on this subject.
NOTE: all i want to do is offer an easy way to remove files from the server-- if i'm going about this task in all the wrong, more difficult manner, please give me the heads up so i can study the right stuff. thanks!!
🙂