<?php
/**
 * modules各个文件需include本文件,可读取user和params
 */
include_once '../../../config.php';set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"]."/".ROOT_DIR."core/aes");
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"]."/".ROOT_DIR."core/base");
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"]."/".ROOT_DIR."busi");
function __autoload($object){
    require_once("{$object}.php");
}$state = json_decode($_GET["state"])[0];
$params = $state->get_params;header('Content-type: text/html; charset=utf8');
session_start();
if (empty($_SESSION['user'])) {
    $busi = new busibase();
    $code = $_GET["code"];
    $agentId = $state->agentId;
    $json_obj = $busi->getUserInfo($code, $agentId);
    $json_obj["UserId"] = addslashes($json_obj["UserId"]);
    $json_obj["DeviceId"] = addslashes($json_obj["DeviceId"]);
    $user_info = json_encode($json_obj);
    $_SESSION['user'] = $user_info;
}//----------测试
//$params = array();
//array_push($params,5);
//
//header('Content-type: text/html; charset=utf8');
//session_start();
//if (empty($_SESSION['user'])) {
//    $json_obj = array();
//    $json_obj["UserId"] = "caijinbang";
//    $user_info = json_encode($json_obj);
//    $_SESSION['user'] = $user_info;
//}
//----------测试
?><!-- 提供给modules往下两级使用 -->
<link type="text/css" rel="stylesheet" href="../../css/common.css">
<script type="text/javascript" src="../../js/jquery-1.11.1.min.js"></script><link rel="stylesheet" type="text/css" href="../../js/jquery-easyui-1.4.2/themes/metro/easyui.css">
<link rel="stylesheet" type="text/css" href="../../js/jquery-easyui-1.4.2/themes/mobile.css">
<link rel="stylesheet" type="text/css" href="../../js/jquery-easyui-1.4.2/themes/color.css">
<link rel="stylesheet" type="text/css" href="../../js/jquery-easyui-1.4.2/themes/icon.css">
<script type="text/javascript" src="../../js/jquery-easyui-1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="../../js/jquery-easyui-1.4.2/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../../js/jquery-easyui-1.4.2/jquery.easyui.mobile.js"></script>
<script type="text/javascript" src="../../js/jquery-easyui-1.4.2/locale/easyui-lang-zh_CN.js"></script><script src="../../js/mobiscroll-master/js/mobiscroll.core.js"></script>
<script src="../../js/mobiscroll-master/js/mobiscroll.frame.js"></script>
<script src="../../js/mobiscroll-master/js/mobiscroll.scroller.js"></script><script src="../../js/mobiscroll-master/js/mobiscroll.util.datetime.js"></script>
<script src="../../js/mobiscroll-master/js/mobiscroll.datetimebase.js"></script>
<script src="../../js/mobiscroll-master/js/mobiscroll.datetime.js"></script>
<script src="../../js/mobiscroll-master/js/mobiscroll.select.js"></script><script src="../../js/mobiscroll-master/js/mobiscroll.frame.sense-ui.js"></script><script src="../../js/mobiscroll-master/js/i18n/mobiscroll.i18n.zh.js"></script><link href="../../js/mobiscroll-master/css/mobiscroll.animation.css" rel="stylesheet" type="text/css" />
<link href="../../js/mobiscroll-master/css/mobiscroll.icons.css" rel="stylesheet" type="text/css" />
<link href="../../js/mobiscroll-master/css/mobiscroll.frame.css" rel="stylesheet" type="text/css" />
<link href="../../js/mobiscroll-master/css/mobiscroll.frame.sense-ui.css" rel="stylesheet" type="text/css" />
<link href="../../js/mobiscroll-master/css/mobiscroll.scroller.css" rel="stylesheet" type="text/css" />
<link href="../../js/mobiscroll-master/css/mobiscroll.scroller.sense-ui.css" rel="stylesheet" type="text/css" />
<link href="../../js/mobiscroll-master/css/mobiscroll.image.css" rel="stylesheet" type="text/css" />

解决方案 »

  1.   

    $state = json_decode($_GET["state"])[0];
    $params = $state->get_params;这个地方报错
      

  2.   

    Notice: Undefined index: state in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 14Notice: Trying to get property 'get_params' of non-object in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 15Warning: require_once(busibase.php): failed to open stream: No such file or directory in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 11Fatal error: require_once(): Failed opening required 'busibase.php' (include_path='C:\xampp\php\PEAR;C:/CX2016//core/aes;C:/CX2016//core/base;C:/CX2016//busi') in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 11
      

  3.   


    Warning: include_once(../../../config.php): failed to open stream: No such file or directory in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 5Warning: include_once(): Failed opening '../../../config.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 5Warning: Use of undefined constant ROOT_DIR - assumed 'ROOT_DIR' (this will throw an Error in a future version of PHP) in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 7Warning: Use of undefined constant ROOT_DIR - assumed 'ROOT_DIR' (this will throw an Error in a future version of PHP) in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 8Warning: Use of undefined constant ROOT_DIR - assumed 'ROOT_DIR' (this will throw an Error in a future version of PHP) in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 9Notice: Undefined index: state in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 14Notice: Trying to get property 'get_params' of non-object in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 15Warning: require_once(busibase.php): failed to open stream: No such file or directory in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 11Fatal error: require_once(): Failed opening required 'busibase.php' (include_path='C:\xampp\php\PEAR;C:\CX2016\cxwx/ROOT_DIRcore/aes;C:\CX2016\cxwx/ROOT_DIRcore/base;C:\CX2016\cxwx/ROOT_DIRbusi') in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 11
      

  4.   

    额,你这个错误有点多啊
    Notice: Undefined index: state in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 14
    这个是没有找到 state  参数 你url 上有state=*** 吗?Notice: Trying to get property 'get_params' of non-object in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 15
    这个因为上面的没有,这里肯定也不对
    Warning: require_once(busibase.php): failed to open stream: No such file or directory in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 11Fatal error: require_once(): Failed opening required 'busibase.php' (include_path='C:\xampp\php\PEAR;C:/CX2016//core/aes;C:/CX2016//core/base;C:/CX2016//busi') in C:\CX2016\cxwx\wxqy\wap\modules\catchuser.php on line 11
    这两个都是说找不到  busibase.php 这个文件你看看路径对不对
      

  5.   

    找不到  busibase.php
      

  6.   

    $state = json_decode($_GET["state"])[0];
    $params = $state->get_params;这个地方报错
    你说这个地方报错,那么传过来的值是json吗?要解码的话, ,true 之后才是数组啊,跨度太大,一点点来吧
      

  7.   

    我已经放弃php换了别的啦