嘿,我正在尝试使用 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");
}
}
如果你能告诉我是否有不同的方式来删除文件或帮助我解决我当前的问题,我会非常感激。
谢谢。