コード例 #1
0
ファイル: update.php プロジェクト: sbrilenko/shirova
    if (!($name = validClass::sanitiseString($_POST['name']))) {
        unset($name);
    }
}
if (isset($_POST['position'])) {
    if (!($position = validClass::sanitiseString($_POST['position']))) {
        unset($position);
    }
}
if (isset($_POST['weight'])) {
    if (!($weight = validClass::validNumber($_POST['weight']))) {
        unset($weight);
    }
}
if (isset($_POST['description'])) {
    if (!($description = $editorClass->replaceToInsert($_POST['description']))) {
        unset($description);
    }
}
if ($id > 0) {
    $imageClass = new imageClass();
    // Обновляем
    $qwery = "UPDATE " . $name_dir . "\n              SET name = '" . $name . "',\n                  position = '" . $position . "',\n                  weight = '" . $weight . "',\n                  description = '" . $description . "'\n              WHERE id='" . $id . "'";
    $db->query($qwery);
    echo "<p style='color:green;'>Данные успешно обновлены</p>";
    if (($tempFile = $_FILES['url_image']['tmp_name']) != "") {
        $targetPath = $root . "/img/" . $name_dir . "/";
        if (!($image_info = $imageClass->getImageInfo($tempFile))) {
            echo "<p style='color:red;'>Обработка файла большого изображения невозможна</p>";
            exit;
        }