I try to delete image in my images directory but still not happen with my image file. I try to use with this code:
<a href=\"../admin/core/de_products.php?id=$row[id]\">Delete</a>
with this function:
<?php
require_once("../inc/con_db.php");
if(isset($_GET["id"]) && $_GET["id"]!="")
{
$image=mysql_query("SELECT * FROM products WHERE id='".$_GET["id"]."'") or die(mysql_error());`
if(mysql_num_rows($image)>0)
{
$row=mysql_fetch_array($image);
$image_name=$row["img_thumb"];`
$check=mysql_query("DELETE FROM products WHERE id='".$_GET["id"]."'") or die(mysql_error());
if($check)
{
@unlink("images/products/thumbs/".$image_name);
echo "Database has been deleted!";
}
else
{
echo "Oops, there is some problem";
}
}
}
?>