Триене на файл

cold_zero

Registered
Имам едно тъпо въпросче :? Как трябва да изглежда кода, за да трие и файла от директория files и директория thumbs

Код:
<?
include ("config.php");
$id=$_GET['id'];
$filename=$_GET['file'];
mysql_connect($host,$user,$pass);
mysql_select_db($dbname) or die( "Unable to select database");
$query ="DELETE FROM $table WHERE id='$id'";
mysql_query($query);
header("Location: ./show.php");
?>
 

Admin

Registered
<?
include ("config.php");
$id=$_GET['id'];
$filename=$_GET['file'];
mysql_connect($host,$user,$pass);
mysql_select_db($dbname) or die( "Unable to select database");
$query ="DELETE FROM $table WHERE id='$id'";
mysql_query($query);

unlink('./files/'.$filename);
header("Location: ./show.php");
?>
 

Горе