I have some files in the directory ../gallery/drawingimage/ i have to delete a file. I have written the following code. But it is not working.
<?php
include("../gallery/includes/connection.php");
$file = $_POST['fname'];
if($_POST['ptype']=='drawing'){
$delete = mysql_query("DELETE FROM drawing WHERE pname = '$file'") or die(mysql_error());
$data=$file.".jpg";
$dir = "../gallery/drawingimage/".$data;
// echo $dir;
unlink('$dir');
}
// header("Location: ../cpanel.php");