Quote:
delete file only deletes images path from the database
Before you execute this command, you need to delete the file from the web server too. At this moment you do have the file path, so just pass that to the PHP function that deletes the file. I would suggest doing this first,
$path = "admin/images/$r";
if(!unlink($path))
{
echo "Not Working";
}
else {
}
Once this line has been executed you lose the file path and you can no longer delete the file—unless you delete everything from the directory, or you capture it from your database backups; or an even stupid solution or deleting everything that doesn't have a link in the database, too bad of a solution!
PHP: unlink - Manual[
^]