Hi I have a developed a script. I can add, remove images though php form and images successfully uploading into remote server directory and database keep the records. If I remove any record, it works and my question is there any code to remove the exact image file from server while I remove the database record? I trust, I could make you understand the fact.
$image_file = "images/sample_image.png"; // you'll need to create something here to write the image name / it should be same url listed in your database if (file_exists($image_file)) { unlink("$image_file"); // unlink() deletes the file from your server } PHP:
code example here: http://www.w3schools.com/php/php_mysql_delete.asp just merge this with MyVodaFone's code above.