本文整理汇总了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);
}
示例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;
示例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) {