Question

I tried deleting the file from folder but it does not work...

I tried changing ' to " but it still does not work...

So I tried putting the exact value, and it worked

    unlink('uploads/12/33.jpg');

This one deletes the image from gallery folder

unlink('gallery/'.$id.'.'.$ext);
unlink('gallery/thumbs/'.$id.'.'.$ext);

This one DOESN'T work.

unlink('uploads/'.$album_id.'/'.$image_id.'.'.$image_ext);
unlink('uploads/thumbs/'.$album_id.'/'.$image_id.'.'.$image_ext);

I even tried changing the dot into a comma and it still didn't work :[

Was it helpful?

Solution

Try

echo "
    unlink('uploads/'.$album_id.'/'.$image_id.'.'.$image_ext);
    unlink('uploads/thumbs/'.$album_id.'/'.$image_id.'.'.$image_ext);
";

and see if it shows you the correct syntax. Maybe you're still having an incorrect value or a missing slash or something.

Please paste your results here if this doesn't help you further.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top