[英]Delete a file on the website using PHP?
嘿,我正在嘗試使用 unlink() 使我的網站刪除文件; 功能。 但是當我嘗試時,它想到了這個:
Warning: unlink() [function.unlink]: cURL does not allow unlinking in /home/nzcraftn/public_html/filenz/user/delete.php on line 18
Warning: Cannot modify header information - headers already sent by (output started at /home/nzcraftn/public_html/filenz/user/delete.php:18) in /home/nzcraftn/public_html/filenz/user/delete.php on line 27
我正在使用此代碼:
if($_SESSION['user'] == $who) {
$delete = unlink("http://www.filenz.nzcraft.net/$dl");
if($delete) {
$_SESSION['message'] = "<div style='color: #00FF00'>File deleted!</div>";
header("Location: index.php");
mysql_query("DELETE FROM fileinfos WHERE(`id`='$id')") or die(mysql_error());
} else {
$_SESSION['message'] = "<div style='color: #FF0000'>Error while deleting!</div>";
header("Location: index.php");
}
}
如果你能告訴我刪除文件的不同方式或幫助我解決我當前的問題,我會非常感激。
謝謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.