當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SessionManager::setCoNm方法代碼示例

本文整理匯總了PHP中SessionManager::setCoNm方法的典型用法代碼示例。如果您正苦於以下問題:PHP SessionManager::setCoNm方法的具體用法?PHP SessionManager::setCoNm怎麽用?PHP SessionManager::setCoNm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SessionManager的用法示例。


在下文中一共展示了SessionManager::setCoNm方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: DBMemberWork

<?php

require_once "../../class/Utils.php";
require_once "../../class/DBWork.php";
require_once "../../class/DBMemberWork.php";
require_once "../../class/SessionManager.php";
$memWork = new DBMemberWork(true);
try {
    //$_POST : [login_id], [login_pw]
    //$memWork->createWork($_GET, false);
    $memWork->createWork($_POST, false);
    $res = $memWork->requestLogin();
    //세션 정보 저장
    $manager = new SessionManager();
    $manager->setUserNm($res['user_name']);
    $manager->setCoNm($res['co_nm']);
    $manager->setUserType($res['auth_id']);
    $headContent = "Location:../../route.php";
    $manager->destory();
    $memWork->destoryWork();
    if ($res) {
        if (isset($_POST["contents"])) {
            $headContent = $headContent . '?contents=' . $_POST["contents"];
            header($headContent);
        } else {
            header($headContent);
        }
    } else {
        $_SESSION['isLoginFail'] = 'y';
        header($headContent);
    }
開發者ID:akswosn,項目名稱:Smartax,代碼行數:31,代碼來源:login_proc.php

示例2: json_encode

<?php

require_once "../../class/Utils.php";
require_once "../../class/DBWork.php";
require_once "../../class/SessionManager.php";
require_once "../../class/DBMemberWork.php";
$memWork = new DBMemberWork(true);
$index = (int) $_POST["index"];
$ret = array();
if ($index > -1) {
    $ret["CODE"] = '00';
    $companyArray = $_SESSION[DBWork::companyArray];
    $comp = $companyArray[$index];
    if (!empty($comp)) {
        //세션 설정
        $_SESSION[DBWork::companyKey] = $comp["co_id"];
        $manager = new SessionManager();
        $manager->setCoNm($comp["co_nm"]);
    } else {
        $ret["CODE"] = '99';
        $ret['MSG'] = "회사정보를 불러오는데 문제가 발생하였습니다.";
    }
    $ret['DATA'] = $comp;
} else {
    $ret["CODE"] = '99';
    $ret['DATA'] = $index;
    $ret['MSG'] = "회사정보를 불러오는데 문제가 발생하였습니다.";
}
echo json_encode($ret);
$memWork->destoryWork();
exit;
開發者ID:akswosn,項目名稱:Smartax,代碼行數:31,代碼來源:change_company_proc.php

示例3: DBMemberWork

require_once "../../class/Utils.php";
require_once "../../class/DBWork.php";
require_once "../../class/DBMemberWork.php";
require_once "../../class/SessionManager.php";
$memWork = new DBMemberWork(true);
try {
    //$_POST : [login_id], [login_pw]
    //$memWork->createWork($_GET, false);
    $_POST['login_id'] = 'sample';
    $_POST['login_pw'] = 'sample';
    $memWork->createWork($_POST, false);
    $res = $memWork->requestLogin();
    //세션 정보 저장
    $manager = new SessionManager();
    $manager->setUserNm($res[3]);
    $manager->setCoNm($res[4]);
    $manager->setUserType($res[1]);
    $headContent = "Location:../../route.php";
    $manager->destory();
    $memWork->destoryWork();
    if ($res) {
        if (isset($_POST["contents"])) {
            $headContent = $headContent . '?contents=' . $_POST["contents"];
            header($headContent);
        } else {
            header($headContent);
        }
    } else {
        header($headContent);
    }
} catch (Exception $e) {
開發者ID:akswosn,項目名稱:Smartax,代碼行數:31,代碼來源:login_proc_test.php


注:本文中的SessionManager::setCoNm方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。