Hola estibaliz2006 bueno hice esto aunque es muy basico pero funciona, espero te sirva
Código PHP:
if (isset($_GET['dir'])){
$path = $_GET['dir'];
}else{
$path = "dir";
}
if(isset($_POST['archivo'])){
for($i=0;$i<sizeof($_POST['archivo']);$i++){
unlink($path . '/' . $_POST['archivo'][$i]);
}
header('Location: test2.php?dir='.$path);
}
echo '<form name="frm" method="post" action="test2.php?dir='.$path.'">';
echo '<table cellspacing="0" cellspadding="0" border="1">';
echo '<tr>';
echo '<td colspan="2">para los marcados<input type="submit" value="Eliminar"></td>';
echo '</tr>';
echo '<tr>';
echo '<td> </td><td>Archivo</td>';
echo '</tr>';
if ($handle = opendir($path))
{
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$fName = $file;
$file = $path.'/'.$file;
if(is_file($file)){////si es un fichero
echo '<tr>';
echo '<td><input type="checkbox" name="archivo[]" value="'.$fName.'"></td>';
echo "<td><a href='".$file."'>".$fName."</a></td>";
echo '</tr>';
}else{
echo '<tr>';
echo '<td> </td>';
echo "<td><a href='test2.php?dir=".$file."'>".$fName."</a></td>";
echo '</tr>';
}
}
}
}
echo '</table>';
echo '</form>';
Saludos