本文整理汇总了PHP中isetcookie函数的典型用法代码示例。如果您正苦于以下问题:PHP isetcookie函数的具体用法?PHP isetcookie怎么用?PHP isetcookie使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isetcookie函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cache_build_account
/**
* 更新用户下的公众号缓存
* @param int $uid
*/
function cache_build_account($uid = 0) {
global $_W;
isetcookie('wechatloaded', '0');
$uid = empty($uid) ? $_W['uid'] : $uid;
cache_build_modules();
cache_load('modules');
$modules = $_W['modules'];
$wechats = pdo_fetchall("SELECT * FROM " . tablename('wechats') . " WHERE uid = '{$uid}' ORDER BY `weid` DESC", array(), 'weid');
$sysmodules = pdo_fetchall("SELECT mid, name FROM ".tablename('modules')." WHERE issystem = '1'", array(), 'mid');
foreach ($sysmodules as $mid => &$module) {
$module['issystem'] = 1;
$module['displayorder'] = -1;
$module['enabled'] = 1;
}
if(!empty($wechats)) {
$founder = explode(',', $_W['config']['setting']['founder']);
foreach ($wechats as $index => $row) {
if (in_array($uid, $founder)) {
$membermodules = pdo_fetchall("SELECT mid, name FROM ".tablename('modules') . " ORDER BY issystem DESC, mid ASC", array(), 'mid');
$modulelist = array();
} else {
$membermodules = pdo_fetchall("SELECT b.mid, b.name FROM ".tablename('members_modules')." AS a LEFT JOIN ".tablename('modules')." AS b ON a.mid = b.mid WHERE a.uid = :uid AND b.name <> '' ORDER BY issystem DESC, mid ASC", array(':uid' => $uid), 'mid');
$modulelist = $sysmodules;
}
$mymodules = pdo_fetchall("SELECT mid, enabled, displayorder FROM ".tablename('wechats_modules')." WHERE weid = '{$row['weid']}' AND mid IN (".implode(",", array_keys($membermodules)).") ORDER BY enabled DESC, displayorder ASC, mid ASC", array(), 'mid');
//拼接模块
if (!empty($mymodules)) {
foreach ($mymodules as $mid => $row){
if (empty($row['enabled'])) {
unset($membermodules[$mid]);
continue;
}
if (!empty($membermodules[$mid])) {
$modulelist[$mid] = $membermodules[$mid];
$modulelist[$mid]['enabled'] = $row['enabled'];
$modulelist[$mid]['displayorder'] = $row['displayorder'];
unset($membermodules[$mid]);
}
}
}
if (!empty($membermodules)) {
$modulelist = array_merge($modulelist, $membermodules);
} elseif (in_array($uid, $founder)) {
$modulelist = $membermodules;
}
unset($row);
foreach ($modulelist as $mid => &$row) {
if (!isset($row['enabled'])) {
$row['enabled'] = 1;
$row['displayorder'] = 127;
}
}
unset($row);
$wechats[$index]['modules'] = $modulelist;
}
}
cache_write('account:'.$uid, $wechats);
}
示例2: _login
function _login($forward = '')
{
global $_GPC, $_W;
load()->model('user');
$member = array();
$username = trim($_GPC['username']);
if (empty($username)) {
message('请输入要登录的用户名');
}
$member['username'] = $username;
$member['password'] = $password = $_GPC['password'];
if (empty($member['password'])) {
message('请输入密码');
}
$record = user_single($member);
if (!empty($record)) {
/*if($record['status'] == 1) {
message('您的账号正在审核或是已经被系统禁止,请联系网站管理员解决!');
}*/
$founders = explode(',', $_W['config']['setting']['founder']);
$_W['isfounder'] = in_array($record['uid'], $founders);
if ($_W['siteclose'] && !$_W['isfounder']) {
$settings = setting_load('copyright');
message('站点已关闭,关闭原因:' . $settings['copyright']['reason']);
}
$cookie = array();
$cookie['uid'] = $record['uid'];
$cookie['lastvisit'] = $record['lastvisit'];
$cookie['lastip'] = $record['lastip'];
$cookie['hash'] = md5($record['password'] . $record['salt']);
$session = base64_encode(json_encode($cookie));
isetcookie('__session', $session, !empty($_GPC['rember']) ? 7 * 86400 : 0);
$status = array();
$status['uid'] = $record['uid'];
$status['lastvisit'] = TIMESTAMP;
$status['lastip'] = CLIENT_IP;
user_update($status);
if (empty($forward)) {
$forward = $_GPC['forward'];
}
if (empty($forward)) {
$forward = './index.php?c=index&a=index';
}
$_W['user'] = $record;
if (cly_isAdmin()) {
message('', url('admin/index'));
} else {
message('', $forward);
}
//message("欢迎回来,{$record['username']}。", $forward);
} else {
message('登录失败,请检查您输入的用户名和密码!');
}
}
示例3: setClientCookieUserInfo
public static function setClientCookieUserInfo($userInfo = array(), $cookieKey)
{
if (!empty($userInfo) && !empty($userInfo['openid'])) {
$cookie = array();
$cookie['openid'] = $userInfo['openid'];
$cookie['nickname'] = $userInfo['nickname'];
$cookie['headimgurl'] = $userInfo['headimgurl'];
$session = base64_encode(json_encode($cookie));
isetcookie($cookieKey, $session, 24 * 3600 * 1);
} else {
message("获取用户信息错误");
}
}
示例4: setClientCookieUserInfo
/**
* author: codeMonkey QQ:631872807
* @param $openid
* @param $accessToken
* @return unknown
* cookie保存用户信息
*/
public static function setClientCookieUserInfo($userInfo = array(), $cookieKey)
{
if (!empty($userInfo) && !empty($userInfo['openid'])) {
$cookie = array();
foreach ($userInfo as $key => $value) {
$cookie[$key] = $value;
}
$session = base64_encode(json_encode($cookie));
isetcookie($cookieKey, $session, 1 * 3600 * 1);
} else {
message("获取用户信息错误");
}
}
示例5: _login
function _login($forward = '')
{
global $_GPC;
load()->model('user');
$member = array();
$username = trim($_GPC['username']);
if (empty($username)) {
message('请输入要登录的用户名');
}
$member['username'] = $username;
$member['password'] = $_GPC['password'];
if (empty($member['password'])) {
message('请输入密码');
}
if ($_GPC['admin']) {
$record = user_single($member);
} else {
$record = biz_login($username, $member['password']);
if (!empty($record)) {
$record['username'] = $record['UserName'];
$record['uid'] = $record['UserGUID'];
$record['password'] = $record['Password'];
}
}
if (!empty($record)) {
if ($record['status'] == -1) {
message('您的账号正在核合或是已经被系统禁止,请联系网站管理员解决!');
}
$cookie = array();
$cookie['uid'] = $record['uid'];
$cookie['lastip'] = $record['lastip'];
$cookie['token'] = $record['Token'];
$cookie['hash'] = md5($record['password'] . $record['salt']);
if ($_GPC['admin']) {
$cookie['admin'] = 1;
}
$session = base64_encode(json_encode($cookie));
isetcookie('__session', $session, 86400);
if (empty($forward)) {
$forward = $_GPC['forward'];
}
if (empty($forward)) {
$forward = './index.php?c=project&a=display';
}
message("欢迎回来,{$record['username']}。", $forward);
} else {
message('登录失败,请检查您输入的用户名和密码!');
}
}
示例6: _login
function _login($forward = '')
{
global $_GPC;
require_once IA_ROOT . '/source/model/member.mod.php';
hooks('member:login:before');
$member = array();
$username = trim($_GPC['username']);
if (empty($username)) {
message('请输入要登录的用户名');
}
$member['username'] = $username;
$member['password'] = $_GPC['password'];
if (empty($member['password'])) {
message('请输入密码');
}
$record = member_single($member);
if (!empty($record)) {
if ($record['status'] == -1) {
message('您的账号正在核合或是已经被系统禁止,请联系网站管理员解决!');
}
$cookie = array();
$cookie['uid'] = $record['uid'];
$cookie['lastvisit'] = $record['lastvisit'];
$cookie['lastip'] = $record['lastip'];
$cookie['hash'] = md5($record['password'] . $record['salt']);
$session = base64_encode(json_encode($cookie));
isetcookie('__session', $session, !empty($_GPC['rember']) ? 7 * 86400 : 0);
$status = array();
$status['uid'] = $record['uid'];
$status['lastvisit'] = TIMESTAMP;
$status['lastip'] = CLIENT_IP;
member_update($status);
hooks('member:login:success');
if (empty($forward)) {
$forward = $_GPC['forward'];
}
if (empty($forward)) {
$forward = './index.php?refersh';
}
message("欢迎回来,{$record['username']}。", $forward);
} else {
message('登录失败,请检查您输入的用户名和密码!');
}
}
示例7: defined
<?php
/**
* [Weizan System] Copyright (c) 2014 012WZ.COM
* Weizan is NOT a free software, it under the license terms, visited http://www.012wz.com/ for more details.
*/
defined('IN_IA') or exit('Access Denied');
error_reporting(0);
load()->classs('captcha');
session_start();
$captcha = new Captcha();
$captcha->build(150, 40);
$hash = md5(strtolower($captcha->phrase) . $_W['config']['setting']['authkey']);
isetcookie('__code', $hash);
$_SESSION['__code'] = $hash;
$captcha->output();
示例8: checkcaptcha
function checkcaptcha($code)
{
global $_W, $_GPC;
session_start();
$codehash = md5(strtolower($code) . $_W['config']['setting']['authkey']);
if (!empty($_GPC['__code']) && $codehash == $_SESSION['__code']) {
$return = true;
} else {
$return = false;
}
$_SESSION['__code'] = '';
isetcookie('__code', '');
return $return;
}
示例9: _mc_login
function _mc_login($member)
{
global $_W;
if (!empty($member) && !empty($member['uid'])) {
$sql = 'SELECT `uid`,`realname`,`mobile`,`email`,`groupid`,`credit1`,`credit2`,`credit6` FROM ' . tablename('mc_members') . ' WHERE `uid`=:uid AND `uniacid`=:uniacid';
$member = pdo_fetch($sql, array(':uid' => $member['uid'], ':uniacid' => $_W['uniacid']));
if (!empty($member) && (!empty($member['mobile']) || !empty($member['email']))) {
$_W['member'] = $member;
$_SESSION['uid'] = $member['uid'];
mc_group_update();
if (empty($_W['openid'])) {
$fan = mc_fansinfo($member['uid']);
if (!empty($fan)) {
$_SESSION['openid'] = $fan['openid'];
$_W['openid'] = $fan['openid'];
$_W['fans'] = $fan;
$_W['fans']['from_user'] = $_W['openid'];
} else {
$_W['openid'] = $member['uid'];
$_W['fans'] = array('from_user' => $member['uid'], 'follow' => 0);
}
}
isetcookie('logout', '', -60000);
return true;
}
}
return false;
}
示例10: message
message('正在恢复数据备份, 请不要关闭浏览器, 当前第 1 卷.', url('system/database/restore'));
}
}
}
if ($_GPC['__restore']) {
$restore = json_decode(base64_decode($_GPC['__restore']), true);
if ($ds[$restore['restore_name']]) {
if ($ds[$restore['restore_name']]['volume'] < $restore['restore_volume']) {
isetcookie('__restore', '', -1000);
message('成功恢复数据备份. 可能还需要你更新缓存.', url('system/database/restore'));
} else {
$sql = file_get_contents($path . $restore['restore_name'] . "/volume-{$restore['restore_prefix']}-{$restore['restore_volume']}.sql");
pdo_run($sql);
$volume = $restore['restore_volume'];
$restore['restore_volume']++;
isetcookie('__restore', base64_encode(json_encode($restore)));
message('正在恢复数据备份, 请不要关闭浏览器, 当前第 ' . $volume . ' 卷.', url('system/database/restore'));
}
} else {
message('非法访问', 'error');
}
}
if ($_GPC['d']) {
$d = $_GPC['d'];
if ($ds[$d]) {
rmdirs($path . $d);
message('删除备份成功.', url('system/database/restore'));
}
}
}
if ($do == 'trim') {
示例11: setClientUserInfo
/**
*
* @param $openid
*/
public function setClientUserInfo($openid)
{
global $_W;
if (!empty($openid)) {
load()->classs('weixin.account');
$accObj = WeixinAccount::create($_W['account']);
$access_token = $accObj->fetch_token();
if (empty($access_token)) {
message("获取accessToken失败");
}
$userInfo = $this->oauth->getUserInfo($access_token, $openid);
if (!empty($userInfo)) {
$cookie = array();
$cookie['openid'] = $userInfo['openid'];
$cookie['nickname'] = $userInfo['nickname'];
$cookie['headimgurl'] = $userInfo['headimgurl'];
$session = base64_encode(json_encode($cookie));
isetcookie('__singnuser', $session, 24 * 3600 * 365);
}
return $userInfo;
}
}
示例12: fans_search
$row = fans_search($pass['fans'], array('salt'));
if (!is_array($row) || empty($row['salt'])) {
$row = array('from_user' => $pass['fans'], 'salt' => '');
}
$hash = md5("{$pass['fans']}{$pass['time']}{$row['salt']}{$_W['config']['setting']['authkey']}");
if ($pass['hash'] == $hash) {
if ($_W['setting']['authmode'] == 2) {
$row = array();
$row['salt'] = random(8);
fans_update($pass['fans'], $row);
}
$cookie = array();
$cookie['openid'] = $pass['fans'];
$cookie['hash'] = substr(md5("{$pass['fans']}{$row['salt']}{$_W['config']['setting']['authkey']}"), 5, 5);
$session = base64_encode(json_encode($cookie));
isetcookie('__msess', $session, 30 * 86400);
}
}
}
}
$forward = @base64_decode($_GPC['forward']);
if (empty($forward)) {
$forward = create_url('mobile/channel', array('name' => 'index', 'weid' => $weid));
} else {
$forward = strexists($forward, 'http://') ? $forward : $_W['siteroot'] . $forward;
}
if (strexists($forward, '#')) {
$pieces = explode('#', $forward, 2);
$forward = $pieces[0];
}
$forward .= '&wxref=mp.weixin.qq.com#wechat_redirect';
示例13: print_addTask
function print_addTask($chips, $backUrl, $printType)
{
global $_W, $_GPC;
$templates = biz_getPrintTemplates($_W['project']['projguid'], $printType, 'id');
if (empty($templates) || count($templates) == 0) {
message('无可用的打印模板,请找管理配置模板!', $backUrl, 'error');
}
$templateId = trim($_GPC['template']);
if (!isset($templates[$templateId])) {
message('无效的打印模板', $backUrl);
}
$prints = biz_getAllPrinter($_W['project']['projguid']);
if (empty($prints) || count($prints) == 0) {
message('无可用的打印机,请找管理员确认打印机配置!', $backUrl, 'error');
}
$titles = biz_getDictionary('printtype');
$printTitle = $titles[$printType];
if (empty($printTitle)) {
message('无效的打印调用!', $backUrl, 'error');
}
$template = $templates[$templateId];
$printId = intval($_GPC['printer']);
//记录当前使用的打印机
isetcookie('__print', $printId);
$print = $prints[$printId];
if (!biz_checkChipsStatus($chips, $printType, 'printstatus')) {
db_updateChipsStatus($chips['id'], $printType, false, 'printstatus');
}
$copy_max = 9;
$copy = intval($_GPC['copy']);
if ($copy <= 0) {
$copy = 1;
}
if ($copy > $copy_max) {
$copy = $copy_max;
}
$printdata = biz_Print_getTemplateData($templateId, $chips);
$task = array('projguid' => $chips['projguid'], 'title' => $chips['cname'] . '-' . $printTitle, 'printid' => $printId, 'moduleid' => $print['moduleid'], 'templateid' => $templateId, 'templatename' => $template['title'], 'key' => $chips['qrcode'], 'printname' => $print['title'], 'printtype' => $printType, 'printdata' => iserializer($printdata), 'createid' => $_W['uid'], 'creator' => $_W['username'], 'copy' => $copy, 'status' => '等待', 'createtime' => TIMESTAMP);
if (pdo_insert('printtask', $task)) {
message('数据已进入排队打印中,请稍候...', $backUrl);
} else {
message('写入打印任务数据出错', $backUrl);
}
}
示例14: defined
<?php
/**
* [Weizan System] Copyright (c) 2014 012WZ.COM
* Weizan is NOT a free software, it under the license terms, visited http://www.012wz.com/ for more details.
*/
defined('IN_IA') or exit('Access Denied');
load()->model('app');
$multiid = intval($_GPC['t']);
$title = $_W['page']['title'];
$navs = app_navs('home', $multiid);
$share_tmp = pdo_fetch('SELECT title,description,thumb FROM ' . tablename('cover_reply') . ' WHERE uniacid = :aid AND multiid = :id AND module = :m', array(':aid' => $_W['uniacid'], ':id' => $multiid, ':m' => 'site'));
$_share['imgUrl'] = tomedia($share_tmp['thumb']);
$_share['desc'] = $share_tmp['description'];
$_share['title'] = $share_tmp['title'];
if (!empty($multiid)) {
isetcookie('__multiid', $multiid);
}
template('home/home');
示例15: template
template('wechat/location_model');
exit;
}
$accdata = $accounts[$acid];
if (empty($_GPC['__color'])) {
load()->classs('coupon');
$acc = new coupon($acid);
$status = $acc->GetColors();
if (is_error($status)) {
message($status['message'], referer(), 'error');
}
foreach ($status['colors'] as $val) {
$colors[$val['name']] = $val;
}
$colors = base64_encode(iserializer($colors));
isetcookie('__color', $colors, 86400 * 7);
}
$colors = iunserializer(base64_decode($_GPC['__color']));
load()->func('tpl');
load()->model('coupon');
load()->classs('coupon');
$setting = pdo_fetch('SELECT * FROM ' . tablename('coupon_setting') . ' WHERE uniacid = :aid AND acid = :cid', array(':aid' => $_W['uniacid'], ':cid' => $acid));
$setting['logourl_'] = media2local($setting['logourl']);
$types = array('discount' => '折扣券', 'cash' => '代金券', 'gift' => '礼品券', 'groupon' => '团购券', 'general_coupon' => '优惠券');
if ($do == 'display') {
$condition = ' WHERE uniacid = :aid AND acid = :cid';
$parma[':aid'] = $_W['uniacid'];
$parma[':cid'] = $acid;
if (!empty($_GPC['type'])) {
$condition .= ' AND type = :type';
$parma[':type'] = $_GPC['type'];