Ragazzi attraverso diversi tentativi "a senso", partendo dal codice postato prima, sono riuscito a:

- mostrare le anteprime dei file
- cancellare i file checkati

Ma non riesco ancora a:

- selezionare solo i file immagine
- spostare i non selezionati in un'altra cartella

HELP!!!!!!!!


<?php
/**
* A sample page to show check box to delete image files
* $Author$
* $Revision$
* $Date$
* $Id$
*/
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);


$file_ary = isset($_POST['rfile']) ? $_POST['rfile'] : array();

/**
* At first visit, show the file list
*/
if (empty($file_ary))
{
//$image_path = 'http://cartella';
$image_path = dirname(__FILE__) . '/';
$dir_handle = null;

if (!($dir_handle = opendir($image_path)))
{
//trigger_error('error, path not found');
return;
}
$html = '<html><form method="post">';
$file = readdir($dir_handle);

while ($file)
{
$html .= "<img src=\"{$file}\" width=\"150\" />
{$file}<input type=\"checkbox\" name=\"rfile[]\" value=\"{$file}\" />

\r\n";
$file = readdir($dir_handle);
}
closedir($dir_handle);

$html .= '<input type="submit" name="submit" value="INVIA" />';
$html .= "</form></html>";
echo $html;
}

/**
* Now, we have list, display it or do anything you need to ..
*/

if (!empty($file_ary))
{
echo (int) empty($file_ary);
echo '<pre>';
$path = $_POST['rfile'];
for ($i=0; $i<count($path); $i++) {
if(@unlink("./".$path[$i])) {echo "Deleted file "; }
else{echo "File can't be deleted";} }
echo '</pre>';


}

?>