本文整理匯總了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;