Hi All, I am not a die-hard php programmer, and ik cannot get this script to work... i have searched this forum and the web, but cannot find exactly what i need. I have made a website with an easy to use CMS. The problem is that when i delete a product, i already achieved to remove the database entry (product and photos) BUT i would like te delete the real image files also... this is what i have got so far.... what am i doing wrong? <?php if ($delete == "yes") { mysql_query("DELETE FROM producten WHERE prodid=($productid)"); $result2=mysql_query("SELECT * FROM productfotos WHERE prodid=($prodid)"); $filedir = '/var/www/html/test/images/productfotos'; $dh = opendir($filedir); unlink($dh.'/'.$result2); closedir($dh); mysql_query("DELETE FROM productfotos WHERE prodid=($productid)"); ?> <b><font color="white">Het product is verwijderd!</font></b><br /> <input type=button value="Window Sluiten" onClick="javascript:opener.location.reload(true);self.close();"> <?php } else { ?>