= '5.1' && !empty($timezone)) { date_default_timezone_set($timezone); } if (isset($_SERVER['PHP_SELF'])) { define('PHP_SELF', $_SERVER['PHP_SELF']); } else { define('PHP_SELF', $_SERVER['SCRIPT_NAME']); } require(ROOT_PATH . 'includes/inc_constant.php'); require(ROOT_PATH . 'includes/cls_ecshop.php'); require(ROOT_PATH . 'includes/cls_error.php'); require(ROOT_PATH . 'includes/lib_time.php'); require(ROOT_PATH . 'includes/lib_base.php'); require(ROOT_PATH . 'includes/lib_common.php'); require(ROOT_PATH . ADMIN_PATH . '/includes/lib_main.php'); require(ROOT_PATH . ADMIN_PATH . '/includes/cls_exchange.php'); /* 对用户传入的变量进行转义操作。*/ if (!get_magic_quotes_gpc()) { if (!empty($_GET)) { $_GET = addslashes_deep($_GET); } if (!empty($_POST)) { $_POST = addslashes_deep($_POST); } $_COOKIE = addslashes_deep($_COOKIE); $_REQUEST = addslashes_deep($_REQUEST); } /* 对路径进行安全处理 */ if (strpos(PHP_SELF, '.php/') !== false) { ecs_header("Location:" . substr(PHP_SELF, 0, strpos(PHP_SELF, '.php/') + 4) . "\n"); exit(); } /* 创建 ECSHOP 对象 */ $ecs = new ECS($db_name, $prefix); define('DATA_DIR', $ecs->data_dir()); define('IMAGE_DIR', $ecs->image_dir()); /* 初始化数据库类 */ require(ROOT_PATH . 'includes/cls_mysql.php'); $db = new cls_mysql($db_host, $db_user, $db_pass, $db_name); $db_host = $db_user = $db_pass = $db_name = NULL; /* 创建错误处理对象 */ $err = new ecs_error('message.htm'); /* 初始化session */ require(ROOT_PATH . 'includes/cls_session.php'); $sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'), 'ECSCP_ID'); /* 载入系统参数 */ $_CFG = load_config(); require(ROOT_PATH . 'languages/' .$_CFG['lang']. '/admin/common.php'); require(ROOT_PATH . 'languages/' .$_CFG['lang']. '/admin/log_action.php'); if (file_exists(ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/' . basename(PHP_SELF))) { include(ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/' . basename(PHP_SELF)); } if (!file_exists('../temp/caches')) { @mkdir('../temp/caches', 0777); @chmod('../temp/caches', 0777); } if (!file_exists('../temp/compiled/admin')) { @mkdir('../temp/compiled/admin', 0777); @chmod('../temp/compiled/admin', 0777); } clearstatcache(); /* 判断是否支持gzip模式 */ if (gzip_enabled()) { ob_start('ob_gzhandler'); } else { ob_start(); } //init.php结束-------------- //require_once(ROOT_PATH . "includes/fckeditor/fckeditor.php"); require_once(ROOT_PATH . 'includes/cls_image.php'); /*初始化数据交换对象 */ $exc = new exchange($ecs->table("article"), $db, 'article_id', 'title'); //$image = new cls_image(); /*检查是否重复*/ $where = empty($_POST['article_cat']) ? '' : " cat_id ='$_POST[article_cat]'"; $is_only = $exc->is_only('title', $_POST['title'],0, $where); if (!$is_only) { echo('[yes]'); }else{ echo('[no]'); } exit; ?>