So I have look through and directory exclude certain files, show files numbered with a delete button and need to write in a delete function to delete the directory and the files in it and not sure how that is written can someone insert an answer.?
Thank you so much
<?php
$dir = './';
$files = scandir($dir);
sort($files);
$count = -1 ;
foreach ($files as $file) {
$v_delete = "delete_".$count;
if ($file != '.' && $file != '..' && $file != 'read.php') {
$str_URL = "./".$file;
echo "<tr>";
echo "<td>";
echo $count;
echo "</td>";
echo "<td>";
echo $file;
echo "</td>";
echo "<td>";
echo "<form action='' method='post'><input type='submit' value='Delete' name='".$v_delete."'/></form>";
if(isset($_POST[$v_delete])) {
// Your php delete code here
echo "delete file : ".$file;
}
echo "</td>";
}
$count++;
}
?>