$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"; } Link to comment https://forums.phpfreaks.com/topic/214323-wont-unlink-file-from-dir/ 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); ?? Link to comment https://forums.phpfreaks.com/topic/214323-wont-unlink-file-from-dir/#findComment-1115305 Share on other sites More sharing options...
$php_mysql$ Posted September 25, 2010 Author Share Posted September 25, 2010 Any help here? Link to comment https://forums.phpfreaks.com/topic/214323-wont-unlink-file-from-dir/#findComment-1115419 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 Link to comment https://forums.phpfreaks.com/topic/214323-wont-unlink-file-from-dir/#findComment-1115450 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.