<?php

function recursive_remove_directory($directory, $empty=FALSE)
 {
     if(substr($directory,-1) == '/')
     {
         $directory = substr($directory,0,-1);
     }
     if(!file_exists($directory) || !is_dir($directory))
     {
         return FALSE;
     }elseif(is_readable($directory))
     {
         $handle = opendir($directory);
         while (FALSE !== ($item = readdir($handle)))
         {
             if($item != '.' && $item != '..')
             {
                 $path = $directory.'/'.$item;
                 if(is_dir($path)) 
                 {
                     recursive_remove_directory($path);
                 }else{
                     unlink($path);
                 }
             }
         }
         closedir($handle);
         if($empty == FALSE)
         {
             if(!rmdir($directory))
             {
                 return FALSE;
             }
         }
     }
     return TRUE;
 }
 // ------------------------------------------------------------
 
 	$getPage = $_GET['p'];
 
	recursive_remove_directory('usrs/'.$getPage.'');
	
	header("Location: manage-users.php");

?>