Re: Delete checked files
| From: | Stefan | Date: | Mon, 25 Feb 2002 16:52:12 +0000 |
| Subject: | Re: Delete checked files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-86114@lists.php.net to get a copy of this message | ||
make a form, one "delete"-button and put a checkbox before every file. the
checkbox's name is 'delete_file['.$filename.']' ... wehen pressed delete
open a file which foreach's every entry in delete_file and unlink it. but be
careful - this could be a huge security-hole ...
+ stefan
"Nautilis" <josemsala@hotmail.com> schrieb im Newsbeitrag
news:20020225160956.2612.qmail@pb1.pair.com...
> 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
>
>
>
>