Jump to content

Delete Thumbs Plus Originals


robyngae
 Share

Recommended Posts

I need to be able to delete thumb from gallery but also the original which is in another folder.Here is my code which deletes the thumb but the original is still in "graphics" folder and as the folder contents are displayed it is important that it is also deleted at the same time.<?php$path = dirname(__FILE__) . '/thumbs/';$f = isset($_GET['f']) ? $_GET['f'] : '';if (file_exists($path . $f) && !is_dir($path . $f)){ unlink($path . $f); echo "$f has been deleted";}else echo $path . $f . ' is not a file';?>Thanks in advance for any adviceRobyn

Link to comment
Share on other sites

The thumbnail and the original picture are two different files, and your code only deletes one file (the thumbnail). Use the unlink function for the original image too.
Thank you for your time, I had worked that out and was logging on to say that I had found the answer.Robyn
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...