del_id ( 'pages', $_POST['id'] ); break; case 'del_img': unset( $a ); $a['id'] = $_POST['id']; $img = $db -> get_val( 'pages', $a, 'img' ); unlink(MYDIR . '/img/pages_cat/' . $img . '.jpg'); $db->free_sql('UPDATE `pages` SET `img` = NULL WHERE `id` = ' . $_POST['id'] . ';'); echo 1; break; default: }