-
-
Save skope/15a4fabb271ae0b2b934 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once(dirname(dirname(__FILE__)) . "/config.php"); | |
$root=WEBSITEROOT_LOCALPATH; | |
$newfolder = $root . $_POST["folder"]; | |
function remfolder($dir) { | |
if(!file_exists($dir)) return true; | |
$cnt = glob($dir . "/" . "*"); | |
foreach ($cnt as $f) { | |
if(is_file($f)) { | |
unlink($f); | |
} | |
if(is_dir($f)) { | |
remfolder($f); | |
} | |
} | |
return rmdir($dir); | |
} | |
if(file_exists ($newfolder)) { | |
//delete the folder | |
remfolder($newfolder); | |
} else { | |
//do nothing | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment