• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP cls_mysql类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中cls_mysql的典型用法代码示例。如果您正苦于以下问题:PHP cls_mysql类的具体用法?PHP cls_mysql怎么用?PHP cls_mysql使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了cls_mysql类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: parse_url

function &db()
{
    include_once 'db.php';
    static $db = null;
    if ($db === null) {
        $cfg = parse_url(DB_CONFIG);
        if ($cfg['scheme'] == 'mysql') {
            if (empty($cfg['pass'])) {
                $cfg['pass'] = '';
            } else {
                $cfg['pass'] = urldecode($cfg['pass']);
            }
            $cfg['user'] = urldecode($cfg['user']);
            if (empty($cfg['path'])) {
                trigger_error('Invalid database name.', E_USER_ERROR);
            } else {
                $cfg['path'] = str_replace('/', '', $cfg['path']);
            }
            $charset = 'utf8';
            $db = new cls_mysql();
            //$db->cache_dir = ROOT_PATH. '/temp/query_caches/';
            $db->connect($cfg['host'] . ':' . $cfg['port'], $cfg['user'], $cfg['pass'], $cfg['path'], $charset);
        } else {
            trigger_error('Unkown database type.', E_USER_ERROR);
        }
    }
    return $db;
}
开发者ID:shitfSign,项目名称:conf_system,代码行数:28,代码来源:mysql.php


示例2: get_waterMark

function get_waterMark()
{
    require_once ROOT_PATH . '/data/config.php';
    require_once ROOT_PATH . '/includes/cls_mysql.php';
    $db = new cls_mysql($db_host, $db_user, $db_pass, $db_name, EC_CHARSET, 0, 1);
    $sql = 'select value from ecs_shop_config where code = "watermark"';
    $watermark = $db->getOne($sql);
    $sql = 'select value from ecs_shop_config where code = "watermark_place"';
    $watermark_place = $db->getOne($sql);
    $sql = 'select value from ecs_shop_config where code = "watermark_alpha"';
    $watermark_alpha = $db->getOne($sql);
    return array('watermark' => $watermark, 'watermark_place' => $watermark_place, 'watermark_alpha' => $watermark_alpha);
}
开发者ID:norain2050,项目名称:benhu,代码行数:13,代码来源:my_func.php


示例3: addTongji

function addTongji($domain, $ip)
{
    global $db, $db_host, $db_user, $db_pass, $db_name, $prefix;
    $ecs = new ECS($db_name, $prefix);
    $db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
    list($dom, $domainname, $ext) = explode('.', $domain);
    $domainname .= '.' . $ext;
    $namemd5 = md5($domainname);
    $userip = $ip;
    try {
        $sql = 'INSERT INTO ' . $ecs->table('userinfo') . ' (`domain_name`, `name_md5`, `addtime`, `userip`, `userpv`) VALUES ("' . $domainname . '","' . $namemd5 . '",' . time() . ',"' . $userip . '",0) ON DUPLICATE KEY UPDATE userpv=userpv+1';
        $db->query($sql);
        return '1';
    } catch (Exception $e) {
        return '0';
    }
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:17,代码来源:record.php


示例4: dump_escape_string

/**
 *    数据库控制器
 *
 *    @author    Hyber
 *    @usage    none
 */
function dump_escape_string($str)
{
    if ($str === null) {
        return null;
    } else {
        if ($str == '') {
            return '';
        } else {
            return cls_mysql::escape_string($str);
        }
    }
}
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:18,代码来源:db.app.php


示例5: error_reporting

<?php

error_reporting(0);
//error_reporting(2047);
define('M_COM', TRUE);
define('M_ROOT', '');
$timestamp = time();
include_once M_ROOT . './base.inc.php';
include_once M_ROOT . './include/general.fun.php';
load_cache('sitemaps');
empty($sitemaps['google']) && exit;
$sitemap = $sitemaps['google'];
$cachefile = M_ROOT . './google.xml';
if (empty($sitemap['setting']['life']) || $timestamp - @filemtime($cachefile) > $sitemap['setting']['life'] * 3600 || !($datastr = file2str($cachefile))) {
    require M_ROOT . './dynamic/cache/mconfigs.cac.php';
    @extract($mconfigs_0);
    include_once M_ROOT . './include/mysql.cls.php';
    $db = new cls_mysql();
    $db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset);
    include_once M_ROOT . './include/common.fun.php';
    include_once M_ROOT . './include/sitemap.inc.php';
    str2file($datastr, $cachefile);
}
echo $datastr;
header("Content-type: application/xml");
exit;
开发者ID:polarlight1989,项目名称:08cms,代码行数:26,代码来源:google.php


示例6: addslashes_deep

    }
    $_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');
/* 初始化 action */
if (!isset($_REQUEST['act'])) {
    $_REQUEST['act'] = '';
} elseif (($_REQUEST['act'] == 'login' || $_REQUEST['act'] == 'logout' || $_REQUEST['act'] == 'signin') && strpos(PHP_SELF, '/privilege.php') === false) {
    $_REQUEST['act'] = '';
} elseif (($_REQUEST['act'] == 'forget_pwd' || $_REQUEST['act'] == 'reset_pwd' || $_REQUEST['act'] == 'get_pwd') && strpos(PHP_SELF, '/get_password.php') === false) {
    $_REQUEST['act'] = '';
}
/* 载入系统参数 */
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:init.php


示例7: md5

     $userinfos['password'] = md5($userdb['password']);
     $userinfos['email'] = addslashes($userdb['email']);
     $ckinfos['time'] = $userdb['time'];
 }
 $userinfos['mname'] = preg_replace("/(c:\\con\\con\$|[%,\\*\"\\s\t\\<\\>\\&])/i", "", $userinfos['mname']);
 if (strlen($userinfos['mname']) > 15) {
     $userinfos['mname'] = substr($userinfos['mname'], 0, 15);
 }
 if (empty($ckinfos['time']) || empty($userinfos['mname']) || empty($userinfos['password'])) {
     empty($_GET['forward']) || header("Location: {$_GET['forward']}");
     exit('member data missing!');
 } elseif ($timestamp - $ckinfos['time'] > $pptin_expire) {
     empty($_GET['forward']) || header("Location: {$_GET['forward']}");
     exit('member data expired!');
 }
 $db = new cls_mysql();
 $db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset);
 if ($cmember = $db->fetch_one("SELECT mid,checked FROM {$tblprefix}members WHERE mname='{$userinfos['mname']}'")) {
     $cmember['password'] != $userinfos['password'] && $db->query("UPDATE {$tblprefix}members SET password='{$userinfos['password']}' WHERE mid={$cmember['mid']}");
     msetcookie('msid', '', -86400 * 365);
     msetcookie('userauth', authcode("{$userinfos['password']}\t{$cmember['mid']}", 'ENCODE'));
 } else {
     //只是写入会员资料记录,当第一次登录时需要激活,将checked设为2。
     $sqlstr = '';
     $userinfos['regip'] = empty($userinfos['regip']) ? onlineip() : $userinfos['regip'];
     $userinfos['regdate'] = empty($userinfos['regdate']) ? $timestamp : $userinfos['regdate'];
     foreach (array('mname', 'password', 'email', 'regip', 'regdate') as $var) {
         $sqlstr .= (empty($sqlstr) ? '' : ',') . "{$var}='{$userinfos[$var]}'";
     }
     $sqlstr .= ",checked='2'";
     $db->query("INSERT INTO {$tblprefix}members SET {$sqlstr}");
开发者ID:polarlight1989,项目名称:08cms,代码行数:31,代码来源:passport_client.php


示例8: get_spt_code

/**
 * 获得spt代码
 *
 * @access  public
 * @return  string   spt代码
 */
function get_spt_code()
{
    include(ROOT_PATH . 'data/config.php');
    include_once(ROOT_PATH . 'includes/cls_ecshop.php');
    include_once(ROOT_PATH . 'includes/cls_mysql.php');
    $db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
    $ecs = new ECS($db_name, $prefix);
    $hash_code = $db->getOne("SELECT value FROM " . $ecs->table('shop_config') . " WHERE code='hash_code'");
    $spt = '<script type="text/javascript" src="http://api.ecshop.com/record.php?';
    $spt .= "url=" .urlencode($ecs->url()). "&mod=install&version=" .VERSION. "&hash_code=" . $hash_code . "&charset=" .EC_CHARSET. "&language=" . $GLOBALS['installer_lang'] . "\"></script>";

    return $spt;
}
开发者ID:noikiy,项目名称:mdwp,代码行数:19,代码来源:lib_auto_installer.php


示例9: __

     $sysmsg[] = __('uc_dbtablepre_error');
 }
 if (!trim($settings['uc_key'])) {
     $error = true;
     $sysmsg[] = __('uc_key_error');
 }
 if (!trim($settings['uc_api'])) {
     $error = true;
     $sysmsg[] = __('uc_api_error');
 }
 if (!$settings['uc_appid']) {
     $error = true;
     $sysmsg[] = __('uc_appid_error');
 }
 if ($settings['connect_uc'] && !$error) {
     $dbuc = new cls_mysql();
     $dbuc->connect($settings['uc_dbhost'], $settings['uc_dbuser'], $settings['uc_dbpwd'], $settings['uc_dbname'], $settings['uc_pconnect']);
     $username = @$dbuc->result_first("select username from `{$settings['uc_dbname']}`.{$settings['uc_dbtablepre']}members where username='{$settings['uc_admin']}' limit 1");
     if ($q) {
         $dbuc->free($q);
     }
     $dbuc->close();
     if (!$username) {
         $error = true;
         $sysmsg[] = __('uc_admin_error');
     }
 }
 if (!$error) {
     $charset_arr = array('gbk' => 'gbk', 'utf-8' => 'utf8');
     $settings['uc_dbcharset'] = $charset_arr[strtolower($settings['uc_charset'])];
     settings_cache($settings);
开发者ID:saintho,项目名称:phpdisk,代码行数:31,代码来源:admin.inc.php


示例10: JSON

}
/* 初始化JSON对象 */
$json = new JSON();
/* 分析JSON数据 */
parse_json($json, $_POST['Json']);
/* 初始化包含文件 */
require ROOT_PATH . 'includes/inc_constant.php';
require ROOT_PATH . 'includes/cls_ecshop.php';
require ROOT_PATH . 'includes/lib_time.php';
require ROOT_PATH . 'includes/lib_main.php';
require ROOT_PATH . 'includes/lib_insert.php';
require ROOT_PATH . 'includes/lib_goods.php';
/* 创建 ECSHOP 对象 */
$ecs = new ECS($db_name, $prefix);
/* 初始化数据库类 */
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db->set_disable_cache_tables(array($ecs->table('sessions'), $ecs->table('sessions_data'), $ecs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = null;
/* 载入系统参数 */
$_CFG = load_config();
/* 载入语言包 */
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/common.php';
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/log_action.php';
/* 初始化session */
include ROOT_PATH . 'includes/cls_session.php';
$sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'), 'CL_ECSCP_ID');
define('SESS_ID', $sess->get_session_id());
/* 判断是否登录了 */
if ((!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <= 0) && $_POST['Action'] != 'UserLogin') {
    client_show_message(110);
}
开发者ID:netroby,项目名称:ecshop,代码行数:31,代码来源:init.php


示例11: addslashes_deep

    }
    $_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 对象  TODO*/
$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();
$_CFG = array("lang" => "zh_cn", "template" => "default", "hash_code" => "feb0af8dda696ecc1a9ba790973096a8", "captcha" => "0");
/* 初始化 action */
if (!isset($_REQUEST['act'])) {
    $_REQUEST['act'] = '';
}
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/common.php';
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/log_action.php';
开发者ID:dalinhuang,项目名称:hteacher,代码行数:31,代码来源:login.php


示例12: empty

 $dsid = empty($dsid) ? 0 : max(0, intval($dsid));
 $dbtable = empty($dbtable) ? '' : trim($dbtable);
 if ($dsid && empty($dbsources[$dsid])) {
     amessage('choosedbs', $forward);
 }
 if (!$dsid) {
     $ndb =& $db;
     $dbsource['cname'] = lang('current_system');
     $dbsource['dbname'] = $dbname;
 } else {
     $dbsource = $dbsources[$dsid];
     $dbsource['dbpw'] && ($dbsource['dbpw'] = authcode($dbsource['dbpw'], 'DECODE', md5($authkey)));
     if (empty($dbsource['cname']) || empty($dbsource['dbhost']) || empty($dbsource['dbuser']) || empty($dbsource['dbname'])) {
         amessage('dbdatamis');
     }
     $ndb = new cls_mysql();
     if (!$ndb->connect($dbsource['dbhost'], $dbsource['dbuser'], $dbsource['dbpw'], $dbsource['dbname'], 0, false, $dbsource['dbcharset'])) {
         amessage('dbconerr');
     }
 }
 $dbtables = array('' => lang('select_table'));
 $query = $ndb->query("SHOW TABLES FROM {$dbsource['dbname']}");
 while ($v = $ndb->fetch_row($query)) {
     $dbtables[$v[0]] = $v[0];
 }
 $dsidsarr = array(0 => lang('current_system'));
 foreach ($dbsources as $k => $v) {
     $dsidsarr[$k] = $v['cname'];
 }
 $filterbox = lang('choose_db_src') . '&nbsp; :&nbsp; ';
 $filterbox .= "<select style=\"vertical-align: middle;\" name=\"dsid\" onchange=\"redirect('?entry=dbsources&action=viewconfigs&dsid=' + this.options[this.selectedIndex].value);\">";
开发者ID:polarlight1989,项目名称:08cms,代码行数:31,代码来源:dbsources.inc.php


示例13: addslashes

    echo '<script language="javascript" reload="1">alert(\'' . addslashes($checkmsg) . '\');parent.$(\'cfupload\').action=\'?entry=mconfigs&action=cfupload\';parent.$(\'cfupload\').target=\'_self\'</script>';
} elseif ($action == 'dbcheck') {
    $checkmsg = '';
    $dbsourcenew = mstripslashes($dbsourcenew);
    if (in_str('********', $dbsourcenew['dbpw'])) {
        $dbsourcenew['dbpw'] = authcode($dbsourcenew['dbpw0'], 'DECODE', md5($authkey));
    }
    $alertarr = array('add' => array('dbsourceadd', 'dbsourcesedit'), 'edit' => array('dbsourcedetail', 'dbsourcedetail'));
    $dbsourcenew['cname'] = trim(strip_tags($dbsourcenew['cname']));
    $dbsourcenew['dbhost'] = trim(strip_tags($dbsourcenew['dbhost']));
    $dbsourcenew['dbuser'] = trim(strip_tags($dbsourcenew['dbuser']));
    $dbsourcenew['dbname'] = trim(strip_tags($dbsourcenew['dbname']));
    if (empty($dbsourcenew['cname']) || empty($dbsourcenew['dbhost']) || empty($dbsourcenew['dbuser']) || empty($dbsourcenew['dbname'])) {
        $checkmsg = lang('dbsrc_data_miss');
    } else {
        $s_db = new cls_mysql();
        if (!$s_db->connect($dbsourcenew['dbhost'], $dbsourcenew['dbuser'], $dbsourcenew['dbpw'], $dbsourcenew['dbname'], 0, false, $dbsourcenew['dbcharset'])) {
            $checkmsg = lang('dbsrc_connect_error');
        } else {
            $checkmsg = lang('dbsrc_connect_correct');
        }
        $s_db->close();
    }
    echo '<script language="javascript" reload="1">alert(\'' . addslashes($checkmsg) . '\');parent.$(\'' . $alertarr[$deal][0] . '\').action=\'?entry=dbsources&action=' . $alertarr[$deal][1] . '\';parent.$(\'' . $alertarr[$deal][0] . '\').target=\'_self\'</script>';
} elseif ($action == 'mailcheck') {
    $mail_to = trim($mconfigsnew['mail_to']);
    $mail_sign = trim($mconfigsnew['mail_sign']);
    $mail_smtp = trim($mconfigsnew['mail_smtp']);
    $mail_mode = trim($mconfigsnew['mail_mode']);
    $mail_port = trim($mconfigsnew['mail_port']);
    $mail_auth = trim($mconfigsnew['mail_auth']);
开发者ID:polarlight1989,项目名称:08cms,代码行数:31,代码来源:checks.inc.php


示例14: create_admin_passport

/**
 * 创建管理员帐号
 *
 * @access  public
 * @param   string      $admin_name
 * @param   string      $admin_password
 * @param   string      $admin_password2
 * @param   string      $admin_email
 * @return  boolean     成功返回true,失败返回false
 */
function create_admin_passport($db_host, $db_user, $db_pass, $db_name, $admin_name, $admin_password, $admin_password2)
{
    include_once ROOT_PATH . 'tools/controllers/includes/cls_mysql.php';
    include_once ROOT_PATH . 'tools/controllers/includes/lib_common.php';
    $db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
    $sql = "INSERT INTO svsys_operators" . "(name,password, created, actions,status)" . "VALUES " . "('{$admin_name}','" . md5($admin_password) . "', " . gmtime() . ", 'all','1')";
    $result = $db->query($sql, 'SILENT');
    if (!empty($result) && $result === false) {
        return false;
    }
    return true;
}
开发者ID:hobbysh,项目名称:seevia-opensource,代码行数:22,代码来源:lib_installer.php


示例15: foreach

 if (empty($_POST['blogname'])) {
     $error[] = '请填写博客名字';
 }
 if ($error) {
     echo '<p class="line">错误信息</p>';
     foreach ($error as $val) {
         echo "<p>{$val}</p>";
     }
     exit;
 }
 $dbhost = $_POST['host'];
 $dbuser = $_POST['dbuser'];
 $dbpw = $_POST['dbpass'];
 $dbname = $_POST['dbname'];
 $charset = 'utf8';
 $db = new cls_mysql();
 if ($db->connect($dbhost, $dbuser, $dbpw, $dbname, $charset, $pconnect)) {
     $error[] = '数据库连接错误';
 }
 if (empty($_POST['dbprefix'])) {
     $dbprefix = 'fb_';
 } else {
     $dbprefix = $_POST['dbprefix'];
 }
 $admin_user = $_POST['admin_user'];
 $admin_pass = $_POST['admin_pass'];
 $blogname = $_POST['blogname'];
 $blogdesc = $_POST['blogdesc'];
 $blog_keyword = $_POST['blogkeyword'];
 $domain = dirname(url());
 $domain = str_replace("install", '', $domain);
开发者ID:az0ne,项目名称:simple_zoomeye,代码行数:31,代码来源:index.php


示例16: addslashes_deep

    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 创建  对象 */
$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->set_disable_cache_tables(array($ecs->table('sessions'), $ecs->table('sessions_data'), $ecs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 创建错误处理对象 */
$err = new ecs_error('message.dwt');
/* 载入系统参数 */
$_CFG = load_config();
/* 当前网站地址 */
$present_url = agency_url();
#####   配置信息(放至所有配置网站一些信息)   #####################
$_CFG['o2o_img_url'] = 'http://' . $present_url;
//.'/o2o/'
define('TMUSER', 'o2o');
/*配置天猫过来的用户名前缀*/
/* 网站图片地址 */
$img_arr = array('http://img1.txd168.com', 'http://img2.txd168.com', 'http://img3.txd168.com');
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:init.php


示例17: instfooter

    </p>
    <p><h4>璇峰厛鍗囩骇鎮ㄧ殑绋嬪簭鍐嶈繘琛屽?鍏ャ€侟/h4></p>
EOT;
    instfooter();
} elseif ($step == 'start') {
    $limit = getgpc('limit', 'P');
    $update = getgpc('update', 'P');
    $insert = getgpc('insert', 'P');
    $success = getgpc('success', 'P');
    $error = getgpc('error', 'P');
    $item_num = 500; // 姣忔?澶勭悊1000涓?細鍛樻暟鎹
    $statistics = array('update' => 0, 'insert' => 0, 'success' => 0, 'error' => 0);
    if (empty($limit)) {
        $limit = 0;
    }
    $uc_db = new cls_mysql(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, UC_DBCHARSET, 0, 1);
    $total_members = $uc_db->getOne("SELECT COUNT(*) FROM ". UC_DBTABLEPRE ."members");
    $sql = "SELECT uid, username, password, email, salt FROM ". UC_DBTABLEPRE ."members ORDER BY uid ASC LIMIT $limit, $item_num";
    $uc_query = $uc_db->query($sql);
    while($member = $uc_db->fetch_array($uc_query)){
        $user_exists = $db->getOne("SELECT COUNT(*) FROM {$prefix}users WHERE `user_name`='{$member['username']}'");
        if (!$user_exists) {
            $sql = "INSERT INTO {$prefix}users (`email`, `user_name`, `password`, `salt`) VALUES('{$member['email']}', '{$member['username']}', '{$member['password']}', '2{$member['salt']}')";
            ++$statistics['insert'];
        } else {
            $sql = "UPDATE {$prefix}users SET `password`='{$member['password']}', `salt`='2{$member['salt']}' WHERE `user_name`='{$member['username']}'";
            ++$statistics['update'];
        }
        $db->query($sql);
        if ($db->affected_rows() > 0) {
            ++$statistics['success'];
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:ucimport.php


示例18: addslashes_deep

    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 对路径进行安全处理 */
if (strpos(PHP_SELF, '.php/') !== false) {
    los_header("Location:" . substr(PHP_SELF, 0, strpos(PHP_SELF, '.php/') + 4) . "\n");
    exit;
}
/* 初始化数据库类 */
require ROOT_PATH . 'includes/cls_mysql.php';
$db_write = new cls_mysql($my_db_host_write, $my_db_user_write, $my_db_pass_write, $my_db_name_write);
$db_read = new cls_mysql($my_db_host_read, $my_db_user_read, $my_db_pass_read, $my_db_name_read);
/* 初始化 action */
if (!isset($_REQUEST['act'])) {
    $_REQUEST['act'] = '';
} elseif (($_REQUEST['act'] == 'login' || $_REQUEST['act'] == 'logout' || $_REQUEST['act'] == 'signin') && strpos(PHP_SELF, '/privilege.php') === false) {
    $_REQUEST['act'] = '';
} elseif (($_REQUEST['act'] == 'forget_pwd' || $_REQUEST['act'] == 'reset_pwd' || $_REQUEST['act'] == 'get_pwd') && strpos(PHP_SELF, '/get_password.php') === false) {
    $_REQUEST['act'] = '';
}
if (!file_exists('temp/caches')) {
    @mkdir('temp/caches', 0777);
    @chmod('temp/caches', 0777);
}
if (!file_exists('temp/compiled')) {
    @mkdir('temp/compiled', 0777);
    @chmod('temp/compiled', 0777);
开发者ID:songtaiwu,项目名称:mordercms,代码行数:31,代码来源:init.php


示例19: make_json_result

    /* 包含插件语言文件 */
    include_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/convert/' . $config->code . '.php';
    /* 取得第一步操作 */
    $step = $convert->next_step('');
    /* 返回 */
    make_json_result($step, $_LANG[$step]);
} elseif ($_REQUEST['act'] == 'process') {
    /* 设置执行时间 */
    set_time_limit(0);
    /* 检查权限 */
    check_authz_json('all');
    /* 取得参数 */
    $step = json_str_iconv($_POST['step']);
    /* 连接原数据库 */
    $config = $_SESSION['convert_config'];
    $sdb = new cls_mysql($config->host, $config->user, $config->pass, $config->db);
    $sdb->set_mysql_charset($config->charset);
    /* 创建插件对象 */
    include_once ROOT_PATH . 'includes/modules/convert/' . $config->code . '.php';
    $convert = new $config->code($sdb, $config->prefix, $config->path, $config->charset);
    /* 包含插件语言文件 */
    include_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/convert/' . $config->code . '.php';
    /* 执行步骤 */
    $result = $convert->process($step);
    if ($result !== true) {
        make_json_error($result);
    }
    /* 取得下一步操作 */
    $step = $convert->next_step($step);
    /* 返回 */
    make_json_result($step, empty($_LANG[$step]) ? '' : $_LANG[$step]);
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:convert.php


示例20: addslashes_deep

        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
define('REMOTE_ADDR', $_SERVER['REMOTE_ADDR']);
/* 创建 ECSHOP 对象 */
$ecs = new ECS($db_name, $prefix);
define('DATA_DIR', $ecs->data_dir());
define('IMAGE_DIR', $ecs->image_dir());
/* 初始化数据库类 */
require ROOT_PATH . 'include/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db->set_disable_cache_tables(array($ecs->table('sessions'), $ecs->table('sessions_data'), $ecs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 创建错误处理对象 */
$err = new ecs_error('message.dwt');
/* 载入系统参数 */
$_CFG = load_config();
$_CFG['URL_HTTP_HOST'] = $config['site_url'];
/* 载入语言文件 */
require ROOT_PATH . 'lang/' . $_CFG['lang'] . '/common.php';
if ($_CFG['shop_closed'] == 1) {
    /* 商店关闭了,输出关闭的消息 */
    header('Content-type: text/html; charset=' . EC_CHARSET);
    die('<div style="margin: 150px; text-align: center; font-size: 14px"><p>' . $_LANG['shop_closed'] . '</p><p>' . $_CFG['close_comment'] . '</p></div>');
}
if (is_spider()) {
开发者ID:GYWang1983,项目名称:fruit,代码行数:31,代码来源:init.php



注:本文中的cls_mysql类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP cls_template类代码示例发布时间:2022-05-23
下一篇:
PHP cls_image类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap