$filetoedit = $_GET['filetoedit'];
if (isset($filetoedit)){
$contents = file_get_contents($filetoedit);
echo '';
}
$filetodelete = $_GET['filetodelete'];
if (isset($filetodelete)){
//unlink($filetodelete);
echo 'unlinked';
}
function recurse($path='./',$level=1) {
$spaces = str_repeat(' ',$level * 8);
$filespaces = str_repeat(' ',$level * 10);
$opendir = opendir($path);
while ($file = readdir($opendir) ){
$exclude = array('error_log','.','..','.ftpquota','recurse.php');
if (in_array($file,$exclude))continue;
$filepath = $path.'/'.$file;
$link = str_replace('.//','',$filepath);
if (is_dir($filepath)){
echo $spaces.''.$file.'
';
recurse($filepath,$level++);
}
else
{
echo $filespaces.''.$file.'';
if (!strpos($file,'.doc'))
{
echo ' EditDelete
';
}
else
{
echo '
';
}
}
}
}
recurse();
?>