Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

italiano40

macrumors 65816
Original poster
Oct 7, 2007
1,080
0
NY
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();
?>
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.