嘿,我正在尝试使我的网站使用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");
}
}
如果您能告诉我是否有其他方法删除文件或帮助我解决当前的问题,我将不胜感激。
谢谢。