Jump to content

wont unlink file from dir?


$php_mysql$

Recommended Posts

any help with this please? it works fine with deleting database results but the unlink wont unlink file from dir?

 

else if($action=="del")
{
    $id = $_GET["id"];
    $cls = $_GET["cls"];
    $dir = "gallery/$cls";
  echo "<p align=\"center\">";
  
  $owner = mysql_fetch_array(mysql_query("SELECT uid FROM gallery WHERE id='".$id."'"));
  if(mod(getuid_id($id))||getuid_id($id)==$owner[0])
  {
    $res = mysql_query("DELETE FROM gallery WHERE id='".$id."'");
$res2 = mysql_query("DELETE FROM comments WHERE pid='".$id."'");
$res3 = mysql_query("DELETE FROM rate WHERE pid='".$id."'");

    if($res||res2||res3 || unlink($dir))
        {
            echo "Photo Deleted From Gallery<br/>";
        }else{
          echo "Database Error!<br/>";
        }
  }else{
    echo "You can't delete this Photo";
  }

Link to comment
https://forums.phpfreaks.com/topic/214323-wont-unlink-file-from-dir/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.