[thelist] how to delete everything in a dir using php

Dunstan Orchard dunstan at 1976design.com
Wed Sep 25 17:32:01 CDT 2002


Hello, me again,

Would anyone know how I can delete all the files within a certain directory on
my server using php?

I have a php page where the user can wipe their entire database with a couple
of clicks (a very well protected page I might add) but as well as wiping the
mysql db (which I've done) I need to delete all the file they might have
uploaded (The directory will always be the same one).


I realise you probably use unlink() but I'm unable to find a way to select
everything in a dir and apply that command to it.

Anyone know a 'select all' command? Or a nice loop...


Thanks for any help you can offer,

- dunstan (on digest, please cc)

---------------------------
Dorset, England
http://www.1976design.com/
http://www.orchard.it/
http://www.maccaws.org/



More information about the thelist mailing list