| Posted by Arjen on 02/04/07 20:28 
Andy schreef:> I have many pictures in the folder. Some of them I want to delete. Because
 > my FTP server shows only 1000 pictures, I am using following script.
 > Unfortunately it deletes single files only and it takes a time to reload
 > after deleting.
 > What I want is your help to modify this script so I would make check marks
 > at the file and than press a button to delete selected files.
 > I am sure there are people who would do it without a problem.
 > Your help will be appreciated.
 
 Presuming the files have no strange characters. Otherwise use
 urlencode($file) iirc. I didn't test this btw so be carefull (use echo
 "unlink ('/path/to/file/'$file)"; first
 
 if (isset($_POST))
 {
 foreach ($_POST['file'] as $myfile)
 {
 unlink('/path/to/file'.$file);
 }
 }
 
 echo '<form>'; // etc
 $handle=opendir($path);
 while (false!==($file = readdir($handle))) {
 if ($file != "." && $file != "..") {
 echo '<input type="checkbox" name="file[]"
 value="'.$file.'"/>'.$file.'<br/>
 }
 }
 closedir($handle);
 echo '<input type = "submit">';//etc
 
 --
 Arjen
 http://www.hondenpage.com
  Navigation: [Reply to this message] |