$php_mysql$ Posted September 24, 2010 Share Posted September 24, 2010 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"; } Quote Link to comment Share on other sites More sharing options...
$php_mysql$ Posted September 24, 2010 Author Share Posted September 24, 2010 i tried printing the $dir and i get the results right print_r(gallery/user5639gin.gif); but still it would not unlink($dir); ?? Quote Link to comment Share on other sites More sharing options...
$php_mysql$ Posted September 25, 2010 Author Share Posted September 25, 2010 Any help here? Quote Link to comment Share on other sites More sharing options...
$php_mysql$ Posted September 25, 2010 Author Share Posted September 25, 2010 nevermind forgot to chmod to 777 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.