I am not able to delete the files from a folder using php whenever the user clicks yes to delete form submission.
The files are still present in the folder even after using unlink()
function:
<form method='post'>
<input type='submit' name='del' value='Yes'>
</form>
<?php
if(isset($_POST['del']))
{
$filename=$userid.".jpg";
unlink('upload-cover/uploads/$userid/$filename');
echo "Your image has been deleted successfully!!";
}
?>