i trying to unlink to delete what i am doing wrong?
Code:
<?php
ob_start();
$code=$_REQUEST['deletecode'];
$picturename=$_REQUEST['picturename'];
$con = mysql_connect("localhost","USERNAME","PASSWORD");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("DB", $con);
$result = mysql_query("SELECT * FROM pictures
WHERE code='$code'");
$row = mysql_fetch_array($result);
if (!unlink('pic/$picturename'))
{
header ('Location: index.php?u=false');
}
else
{
mysql_query("DELETE FROM pictures WHERE code=$code",$con);
header ('Location: index.php?u=true');
}
mysql_close($con);
ob_flush();
?>