robyngae Posted January 2, 2009 Share Posted January 2, 2009 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 More sharing options...
zppblood Posted January 2, 2009 Share Posted January 2, 2009 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. Link to comment Share on other sites More sharing options...
robyngae Posted January 2, 2009 Author Share Posted January 2, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.