RE: [PHP-DB] Delete selected files
| From: | Beau Lebens | Date: | Tue, 26 Feb 2002 02:04:32 +0000 |
| Subject: | RE: [PHP-DB] Delete selected files | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-17289@lists.php.net to get a copy of this message | ||
your checkboxes should pass a value (probably just the filename) and you
could perhaps name them all "filenames[]" or something, using the array
trick in PHP, so that on the page you submit to, $filenames will be an array
containing everything that was checked.
you can then loop thru the array and unlink() each filename in there.
HTH
beau
// -----Original Message-----
// From: Nautilis [mailto:josemsala@hotmail.com]
// Sent: Monday, 25 February 2002 10:43 PM
// To: php-db@lists.php.net
// Subject: [PHP-DB] Delete selected files
//
//
// Hi everybody,
//
// I show a list of files that I upload to the user's folder
// using the next
// code:
//
// $path= "../clients/$user";
// $dir = opendir ($root);
// while ($archivo = readdir ($dir))
// {
// $size = filesize("$path/$filename");
// $size = ($size/1024);
// $size = intval($size * 100 ) / 100;
// if ($filename!= "." && $filename!="..")
// {
// echo "<tr><td><a
// href='$path/$filename'>$filename</a></td><td>$size
Kb</td></tr>";
// }
// }
//
// I want to add a checkbox in every file i get in the user's folder. My
// question is:
//
// Is there any way to use some kind of function to delete
// selected files? I am
// not sure if i can use javascript to evaluate which is
// checked and how. And
// after that evaluation, how to call a unlink ($filename) to
// delete the files.
//
// Any help would be greatly appreciated.
//
// Nau
//
//
//
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
//