I have a <a>, on click delete a product from database that is on server, I want to delete the product
and the same time delete the image of that product. I using unlink() my code delete the product but don't
delete the image and I don't no why someone can tell me what is missing ?
if((isset($_GET["remove"])) && ($_GET["remove"] != "")){ $idproduct = $_GET["remove"]; $sql ="DELETE FROM product WHERE idproduct = '".$idproduct."'"; if(mysqli_query($connect, $sql) or die ("Erro")){ //the part that don't work $file = $frontpage_url."/images/".$_FILES["imagem"]["name"]; unlink($file); echo "success"; } }