Skip to content
Advertisement

php image delete unlink() issue on localhost

image delete unlink() issue on localhost:

My Code Snippet (Not Working):

if(file_exists('./uploads/Property/'.$imgnm))
{ 
    unlink('./uploads/Property/'.$imgnm);
}

My Code Snippet (Working):

if(file_exists('./uploads/Property/300X300/'.$imgthumbnm))
{
   unlink('./uploads/Property/300X300/'.$imgthumbnm);
}

I checked $imgnm & $imgthumbnm variable values carefully.. values are correct

then why not image getting deleted in first code snippet, please suggest me changes or idea to resolve this issue

Advertisement

Answer

If all is okay then surely issue is with variable $imgnm.. check it carefully

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement