Jump to content

Archived

This topic is now archived and is closed to further replies.

bizerk

Adding a Delete All Function

Recommended Posts

Guys what should i do to make a Delete All function. Right now i have a list of all these files uploaded and a link under it saying DELETE FILE and when you click that it unlinks the . I want this to remain but have a new checkbox that says DELETE ALL, and making it unlink ALL files in that specific user directory.

here is the code:
[code]function delete($user_dat, $globalvars)
{
$split_imgname = explode('.', $_GET['delete']);

if($split_imgname[1] == null)
{
echo "We shall have no directory deleting here.";

$exitp = new template();
$exitp->exitp($user_dat, $globalvars);
}

if(unlink($user_dat['usrdir'] . "/" . $_GET['delete']))
{
@unlink($user_dat['usrdir'] . "/thumbnails/" . $split_imgname[0] . ".gif");

echo "<i>" . $_GET['delete'] . "</i> has been deleted successfully. ";
echo 'Click <a href="' . $_SERVER['PHP_SELF'] . '?action=imgdir">here</a> to go back.';
} else {
echo "Could not remove the image because of unknown errors. ";
echo 'Click <a href="' . $_SERVER['PHP_SELF'] . '?action=imgdir">here</a> to go back.';[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.