예제 #1
0
파일: baseDB.php 프로젝트: restartit/test
 public function Update()
 {
     $st = "UPDATE {$this->mytablename} SET ";
     $index = 0;
     foreach ($this as $key => $value) {
         if ($value != $this->mytablename) {
             if ($index == 0) {
                 $st .= $key . '=' . "'" . inputFilter($value) . "'";
             } else {
                 $st .= ',' . $key . '=' . "'" . inputFilter($value) . "'";
             }
             $index++;
         }
     }
     $st .= "WHERE Id={$this->Id}";
     $query = mysql_query($st) or die(mysql_error() . ' ' . $st);
 }
예제 #2
0
파일: index.php 프로젝트: xx-wu/games-cps
<?php

if (!defined('IN_QIJIN_AD_SYSTEM')) {
    exit;
}
$src = isset($_GET['s']) ? $_GET['s'] : '';
$key = inputFilter($src);
if (empty($key)) {
    //跳到默认页
    $key = 'default';
}
include BASE_PATH . 'adconfig.php';
if (empty($adnums) || !is_array($adnums)) {
    die('missing data!~');
}
if (!array_key_exists($key, $adnums)) {
    $key = 'default';
}
//处理素材
$material_num = $adnums[$key]['material'];
$game_mark = $adnums[$key]['game_mark'];
$server_id = $adnums[$key]['server_id'];
$id = $adnums[$key]['id'];
if (strpos($material_num, ',') > -1) {
    $material_num = explode(',', $material_num);
    $randk = mt_rand(0, count($material_num) - 1);
    $material_num = $material_num[$randk];
}
$path = MATERIAL_PATH . $material_num . '/';
include PAGE_PATH . 'index.php';
예제 #3
0
파일: index.php 프로젝트: xx-wu/games-cps
<?php

session_start();
header('content-type:text/html;charset=utf-8');
define('IN_QIJIN_AD_SYSTEM', 'this is ad system entrance');
define('BASE_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
define('APPNAME', 'games-cps');
define('DOCUMENT_ROOT', APPNAME == '' ? '/' : '/' . APPNAME . '/');
$api = 'http://www.games.com/uapi.php';
require_once BASE_PATH . 'config.inc.php';
require_once BASE_PATH . DB_CLASS . '.class.php';
require_once BASE_PATH . 'common.php';
if (!get_magic_quotes_gpc()) {
    $_GET = daddslashes($_GET);
    $_POST = daddslashes($_POST);
    $_COOKIE = daddslashes($_COOKIE);
    $_FILES = daddslashes($_FILES);
}
if (empty($_REQUEST['tp'])) {
    $tp = 'index';
} else {
    $tp = inputFilter($_REQUEST['tp']);
}
$db = new DB();
require_once BASE_PATH . 'ad/' . $tp . '.php';
예제 #4
0
파일: ajax.php 프로젝트: xx-wu/games-cps
        exit;
    } else {
        if ($op == 'checkuname') {
            echo Post($api, $_POST);
            exit;
        } else {
            if ($op == 'pv_before') {
                $ad_id = inputFilter($_POST['k']);
                if (empty($ad_id)) {
                    $ad_id = 'default';
                }
                $tableName = $ad_id . '_pv_before';
                $time = strtotime(date('Y-m-d') . ' 00:00:00');
                $db->query("insert into {$tableName} (time,subsite) values ({$time},'')");
                exit;
            } else {
                if ($op == 'pv_after') {
                    $ad_id = inputFilter($_POST['k']);
                    if (empty($ad_id)) {
                        $ad_id = 'default';
                    }
                    $tableName = $ad_id . '_pv_after';
                    $time = strtotime(date('Y-m-d') . ' 00:00:00');
                    $db->query("insert into {$tableName} (time,subsite) values ({$time},'')");
                    exit;
                }
            }
        }
    }
}
//url = index.php?tp=ajax&op=reg&k=1