Here are two simple files that should work easily; however, the first, the folder code, does not display the folder contents, and the active links to them that would be needed to delete the files by linking them to delete.php file.
Code for folder containing files that might be deleted
Code:
$file = urlencode($dirArray[$index]);
print("<td><a href=\"delete.php?file=$file\">Delete $dirArray[$index]</a></td>");
$file variable should be defined to show contents of folder, so I tried using scandirectory.
Code:
<?php
$dir = '/';
$file = scandir($dir);
print_r($file);
$file = urlencode($dirArray[$index]);
print("<td><a href=\"delete.php?file=$file\">Delete $dirArray[$index]</a></td>");
nothing broken, but it dislayed this array instead of the folder contents: Array ( [0] => . [1] => .. [2] => bin [3] => boot [4] => dev [5] => etc [6] => hermes [7] => home [8] => lib [9] => lib32 [10] => lib64 [11] => opt [12] => proc [13] => run [14] => sbin [15] => selinux [16] => sys [17] => tmp [18] => usr [19] => var )
The delete file could be in a number of formats; I;m using this: