本文整理汇总了PHP中FileData::DeleteFile方法的典型用法代码示例。如果您正苦于以下问题:PHP FileData::DeleteFile方法的具体用法?PHP FileData::DeleteFile怎么用?PHP FileData::DeleteFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileData
的用法示例。
在下文中一共展示了FileData::DeleteFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlentities
$Title = htmlentities($_POST['title']);
$Parent = $_POST['parent'];
$Status = $_POST['status'] == "on" ? 'A' : 'I';
$Insert = $DB->execQuery('insert', 'category', 'title,parent_id,status,image,creation_date', "'" . $Title . "'," . $Parent . ",'" . $Status . "','" . $Image . "',NOW()");
$ID = $DB->GetInsertId();
//echo $DB->lastQuery();
die;
break;
case 'update':
$ID = $_POST['id'];
$Edit = new Category($ID);
if (count($_FILES['img']) > 0) {
$Name = "file" . intval(rand() * rand() / rand() + rand());
$Img = new FileData($_FILES['img'], "../../../skin/images/categories/", $Name);
if (file_exists($Edit->Data['image'])) {
$Img->DeleteFile($Edit->Data['image']);
}
$Image = $Img->BuildImage(45, 45);
$ImgFilter = ",img='" . $Image . "'";
}
$Title = htmlentities($_POST['title']);
$Parent = $_POST['parent'];
$Status = $_POST['status'] == "on" ? 'A' : 'I';
$Insert = $DB->execQuery('update', 'category', "title='" . $Title . "',parent_id=" . $Parent . ",status='" . $Status . "'" . $ImgFilter, "category_id=" . $ID);
//echo $DB->lastQuery();
die;
break;
case 'delete':
$ID = $_POST['id'];
$DB->execQuery('update', 'category', "status = 'I'", "category_id=" . $ID);
die;