Re: [PHP] How To Delete All Files In A Directory

2002-11-12 Thread @ Edwin
Hello, "@ Nilaab" <[EMAIL PROTECTED]> wrote: > Hello Everyone, > > I have a directory that I want emptied everytime a script accesses a certain > function. I tried using rmdir() and then mkdir(), thinking that it will > delete the directory and the contents within it, and would create a brand > n

RE: [PHP] How To Delete All Files In A Directory

2002-11-12 Thread Martin Towell
you could break out into the shell and do rm $dir/*(rm -r $dir/* if there's directories too) (or del $dir/*.* for dos) or use opendir, readdir, closedir to read the directory's content and use unlink to delete the file(s) (if $dir is not hardcoded, I can see a security hole he