...

View Full Version : How do I delete a folder?



webandwe
06-06-2007, 11:07 AM
Hi,

I want to delete a folder on the server using php code. I can only find the code to delete files from the server and not the folder with files.

I searched Google and php.com but all I get is:

#$myFile = "filetodlete";
#unlink($myFile);

---------------------------------

#$myFile = "filetodelete";
#ftp_delete($myFile);


Is there something I can change or a other code I can use to delete folders?

Thanks

webandwe
06-06-2007, 11:18 AM
Found it and Got it working!

Just for all of you who would like to delete folders in the future here is the code.

-------------------------------
$dfolder = $_POST['dfolder'];


$myFile = "$dfolder";
rmdir($myFile);
----------------------------
Just write your own form for it....

:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum