我正在嘗試在 Codeigniter 中洗掉具有取消鏈接功能的 php 檔案?它有一條路徑:
./public_html/application/views/driver/tobedeleted.php
所以要洗掉這個檔案,我創建了一個類似的路線
$route['delete']='my_controller/delete';
在我的控制器的洗掉功能中,我正在執行我的 web 目錄中的 testdelete.php 腳本。
public function delete(){
$this->load->view('web/testdelete');
}
這是testdelete.php的代碼:
<?php
unlink("./public_html/application/views/driver/tobedeleted.php");
?>
但是每當我嘗試這樣做時,它都會說:
檔案未找到
誰能幫我這個 。提前感謝<3。
uj5u.com熱心網友回復:
請用:
unlink(FCPATH."/application/views/driver/tobedeleted.php");
FCPATH 攜帶根路徑,直到應用程式檔案夾。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/406036.html
標籤:
