-1
文件,從數據庫中刪除而不是從本地文件夾警告取消鏈接出現:文件路徑上拒絕的權限PHP的unlink()函數拒絕的權限問題
if(isset($_POST['delete'])){
$checkedCandidates = 0;
$id = implode(",", $_POST['deletecb']);
$checkedCandidates = count($id);
$res=mysqli_query("SELECT file FROM video_gallery where id_vid IN($id) and users_name='$login_session'");
mysqli_fetch_array($res);
#chown(data/58f60f2e09f07_jay/videos, 777);
// here "data/58f60f2e09f07_jay" is file path
unlink("data/58f60f2e09f07_jay/$row[FILE_NAME]");
$query1=mysqli_query($connection,"delete from video_gallery where id_vid IN($id) and users_name='$login_session'");
if($query1)
{
echo "<div id=\"successmsg\"> delete successfully </div>";
}
else
{
echo "<div id=\"errormsg\"> failed operation!!</div>";
}
}
}
請使用編輯器的標記特徵的寫入權限工作,這是不可讀的;還包括你在'videos'目錄中設置了哪些權利 – vv01f
unlink(「path/$ row [FILE_NAME]」); 什麼是路徑?並使用$ row ['FILE_NAME']; – Exprator
路徑是文件路徑,即「data/58f60f2e09f07_jay」 – pranay