예제 #1
0
파일: UserLogin.php 프로젝트: xtzlyp/newpi
 function doLogin()
 {
     // $db = Db::init('hihus');
     // $sql = 'select * from users where 1=1';
     // $res = $db->query($sql);
     // while($l = $res->fetch(PDO::FETCH_ASSOC)){
     // 	print_r($l);
     // }
     $mem = Mem::get('users');
     $mem->set("hihu", "100", 10 * 60);
     $s = $mem->get("hihu");
     var_dump($s);
 }
예제 #2
0
require './config.php';
$type = __gett('type', 'insurance');
$ads_id = __gett('ads_id', '');
// 调用数据库的数据
if ($type == "system") {
    DB::setBait('zhq', array('127.0.0.1', 'weiche_web', 'root', '000000', 3306));
    DB::setHarpoon('zhq');
    $sql = 'SELECT * FROM `weiche_ads` where `baidu_id` = ?';
    $ads_data = DB::getAll($sql, array($ads_id));
    foreach ($ads_data as $key => $vv) {
        $ads_data[$key]['id'] = $vv['baidu_id'];
    }
} else {
    $key = $type . 'vehicle_web_ads_json' . $ads_id;
    $ads_json = Mem::get($key);
    if (!$ads_json) {
        $url = 'http://img-src.buding.cn/weiche/ads.js?flush=' . time();
        $ads_json = @file_get_contents($url);
        if ($ads_json) {
            Mem::set($key, $ads_json, 600);
        } else {
            die('json is null');
        }
    }
    $ads_data = json_decode($ads_json, true);
}
$banner = '';
$style = '';
if (!$ads_id) {
    switch ($type) {