本文整理汇总了PHP中ssetcookie函数的典型用法代码示例。如果您正苦于以下问题:PHP ssetcookie函数的具体用法?PHP ssetcookie怎么用?PHP ssetcookie使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ssetcookie函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clearcookie
function clearcookie()
{
global $_SGLOBAL;
obclean();
ssetcookie('auth', '', -86400 * 365);
$_SGLOBAL['supe_uid'] = 0;
$_SGLOBAL['supe_username'] = '';
$_SGLOBAL['member'] = array();
}
示例2: freshcookie
function freshcookie($itemid)
{
global $_SC, $_SGLOBAL;
$isupdate = 1;
$old = empty($_COOKIE[$_SC['cookiepre'] . 'supe_refresh_items']) ? 0 : trim($_COOKIE[$_SC['cookiepre'] . 'supe_refresh_items']);
$itemidarr = explode('_', $old);
if (in_array($itemid, $itemidarr)) {
$isupdate = 0;
} else {
$itemidarr[] = trim($itemid);
ssetcookie('supe_refresh_items', implode('_', $itemidarr));
}
if (empty($_COOKIE)) {
$isupdate = 0;
}
return $isupdate;
}
示例3: wz_checkauth
function wz_checkauth($wxid, $token, $mid, $op_wxid)
{
global $_SGLOBAL;
if ($_COOKIE['site_auth']) {
@(list($password, $token_id) = explode(" ", authcode($_COOKIE['site_auth'], 'DECODE')));
$_SGLOBAL['supe_token_id'] = intval($token_id);
if ($password && $_SGLOBAL['supe_token_id']) {
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname("wz_session") . " WHERE token_id=" . $_SGLOBAL['supe_token_id']);
if ($session = $_SGLOBAL['db']->fetch_array($query)) {
if ($session['password'] == $password) {
$token_mid = $_SGLOBAL['db']->getone('select mid from ' . tname('wz_token') . ' where id=' . $_SGLOBAL['supe_token_id']);
$token_op_wxid = $_SGLOBAL['db']->getone('select op_wxid from ' . tname('wz_token') . ' where id=' . $_SGLOBAL['supe_token_id']);
if ($token_mid == $mid && $token_op_wxid == $op_wxid) {
updatetable(tname('wz_token'), array('state' => 1), array('wxid' => $session['wxid'], 'mid' => $mid, 'op_wxid' => $op_wxid));
$_SGLOBAL['supe_wxid'] = addslashes($session['wxid']);
wz_insertsession($session);
//更新session
return $_SGLOBAL['supe_token_id'];
}
}
}
}
}
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname("wz_token") . " WHERE wxid='" . $wxid . "' and mid=" . $mid . " and op_wxid=" . $op_wxid . " and state=0");
if ($wz = $_SGLOBAL['db']->fetch_array($query)) {
if ($wz['token'] == $token) {
updatetable(tname('wz_token'), array('state' => 1), array('wxid' => $wxid, 'mid' => $mid, 'op_wxid' => $op_wxid));
$_SGLOBAL['supe_wxid'] = addslashes($wz['wxid']);
$session = array('token_id' => $wz['id'], 'wxid' => $_SGLOBAL['supe_wxid'], 'password' => $token);
wz_insertsession($session);
//登录
$cookietime = 3600;
//3600 * 24 * 15;
//设置cookie
ssetcookie('site_auth', authcode($session["password"] . ' ' . $session["token_id"], 'ENCODE'), $cookietime);
$_SGLOBAL['supe_token_id'] = $session['token_id'];
return $_SGLOBAL['supe_token_id'];
}
}
obclean();
ssetcookie('site_auth', '', -86400 * 365);
return 0;
}
示例4: updatetable
updatetable('space', array('friendnum' => count($fuids), 'pokenum' => count($pokes)), array('uid' => $newuid));
updatetable('spacefield', array('friend' => $friendstr, 'feedfriend' => $friendstr), array('uid' => $newuid));
//更新默认用户好友缓存
include_once S_ROOT . './source/function_cp.php';
foreach ($fuids as $fuid) {
friend_cache($fuid);
}
}
}
}
//在线session
insertsession($setarr);
//设置cookie
ssetcookie('auth', authcode("{$setarr['password']}\t{$setarr['uid']}", 'ENCODE'), 2592000);
ssetcookie('loginuser', $username, 31536000);
ssetcookie('_refer', '');
//好友邀请
if ($invitearr) {
include_once S_ROOT . './source/function_cp.php';
invite_update($invitearr['id'], $setarr['uid'], $setarr['username'], $invitearr['uid'], $invitearr['username'], $app);
//如果提交的邮箱地址与邀请相符的则直接通过邮箱验证
if ($invitearr['email'] == $email) {
updatetable('spacefield', array('emailcheck' => 1), array('uid' => $newuid));
}
//统计更新
include_once S_ROOT . './source/function_cp.php';
if ($app) {
updatestat('appinvite');
} else {
updatestat('invite');
}
示例5: realname_set
realname_set($value['vuid'], $value['vusername']);
}
$value['isfriend'] = 0;
if ($space['friends'] && in_array($value['vuid'], $space['friends'])) {
$value['isfriend'] = 1;
}
$oluids[$value['vuid']] = $value['vuid'];
$visitorlist[$value['vuid']] = $value;
}
//애ᅫᅧᅪᄈ터
$viewuids = $_SCOOKIE['viewuids'] ? explode('_', $_SCOOKIE['viewuids']) : array();
if ($_SGLOBAL['supe_uid'] && !$space['self'] && !in_array($space['uid'], $viewuids)) {
$_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET viewnum=viewnum+1 WHERE uid='{$space['uid']}'");
//애ᅨ까
$viewuids[$space['uid']] = $space['uid'];
ssetcookie('viewuids', implode('_', $viewuids));
}
//ᅰᅱᄒ
$bloglist = array();
if ($_SGLOBAL['mygroupid'] == 3 || $space['blognum'] && ckprivacy('blog')) {
$query = $_SGLOBAL['db']->query("SELECT b.uid, b.blogid, b.subject, b.dateline, b.pic, b.picflag, b.viewnum, b.replynum, b.friend, b.password, bf.message, bf.target_ids\r\n\t\tFROM " . tname('blog') . " b\r\n\t\tLEFT JOIN " . tname('blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\tWHERE b.uid='{$space['uid']}'\r\n\t\tORDER BY b.weight DESC, b.dateline DESC LIMIT 0,5");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
if ($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
}
$value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], 150, 0, 0, 0, 0, -1);
$bloglist[] = $value;
}
}
$blognum = count($bloglist);
示例6: COUNT
if ($multi_mode) {
$c_sql = "SELECT COUNT(*) FROM " . tname('space');
} else {
$count = 100;
$cache_file = S_ROOT . './data/cache_top_viewnum.txt';
}
$sql = "SELECT main.*, field.* FROM " . tname('space') . " main\r\n\t\tLEFT JOIN " . tname('spacefield') . " field ON field.uid=main.uid\r\n\t\tORDER BY main.viewnum DESC";
//我的位置
$cookie_name = 'space_top_' . $_GET['view'];
if ($_SCOOKIE[$cookie_name]) {
$now_pos = $_SCOOKIE[$cookie_name];
} else {
$pos_sql = "SELECT COUNT(*) FROM " . tname('space') . " s WHERE s.viewnum>'{$space['viewnum']}'";
$now_pos = $_SGLOBAL['db']->result($_SGLOBAL['db']->query($pos_sql), 0);
$now_pos++;
ssetcookie($cookie_name, $now_pos);
}
} elseif ($_GET['view'] == 'online') {
$c_sql = "SELECT COUNT(*) FROM " . tname('session');
$sql = "SELECT field.*, space.*, main.*\r\n\t\tFROM " . tname('session') . " main USE INDEX (lastactivity)\r\n\t\tLEFT JOIN " . tname('space') . " space ON space.uid=main.uid\r\n\t\tLEFT JOIN " . tname('spacefield') . " field ON field.uid=main.uid\r\n\t\tORDER BY main.lastactivity DESC";
$now_pos = -1;
} elseif ($_GET['view'] == 'updatetime') {
$c_sql = "SELECT COUNT(*) FROM " . tname('space');
$sql = "SELECT main.*, field.* FROM " . tname('space') . " main USE INDEX (updatetime)\r\n\t\tLEFT JOIN " . tname('spacefield') . " field ON field.uid=main.uid\r\n\t\tORDER BY main.updatetime DESC";
$now_pos = -1;
}
$list = array();
if (empty($count)) {
$cache_mode = false;
$count = empty($_SCONFIG['networkpage']) ? 1 : $_SGLOBAL['db']->result($_SGLOBAL['db']->query($c_sql), 0);
$multi = multi($count, $perpage, $page, "space.php?do=top&view={$_GET['view']}");
示例7: synlogin
function synlogin($get, $post)
{
global $_SGLOBAL;
if (!API_SYNLOGIN) {
return API_RETURN_FORBIDDEN;
}
//note 同步登录 API 接口
obclean();
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
$cookietime = 31536000;
$uid = intval($get['uid']);
$query = $_SGLOBAL['db']->query("SELECT uid, username, password FROM " . tname('member') . " WHERE uid='{$uid}'");
if ($member = $_SGLOBAL['db']->fetch_array($query)) {
include_once S_ROOT . './source/function_space.php';
$member = saddslashes($member);
$space = insertsession($member);
//设置cookie
ssetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime);
}
ssetcookie('loginuser', $get['username'], $cookietime);
}
示例8: ssetcookie
if ($mname == 'shop' && $_GET['action'] == 'edit' && empty($_POST['valuesubmit']) && empty($_GET['op'])) {
if (!empty($_GET['itemid'])) {
ssetcookie('shopid', $_GET['itemid'], 3600 * 10);
getpanelinfo($_GET['itemid']);
if (!empty($_G['cookie']['i_referer'])) {
header('Location: ' . $_G['cookie']['i_referer']);
}
} elseif (!empty($_G['cookie']['shopid'])) {
getpanelinfo(intval($_G['cookie']['shopid']));
}
if (!empty($_SGLOBAL['panelinfo'])) {
echo '<script type="text/javascript" charset="' . $_G['charset'] . '">var leftmenu = $(window.parent.document).find("#leftmenu");leftmenu.find("ul").css("display", "none");$(window.parent.document).find("#menu_paneladd").css("display", "");</script>';
}
} elseif (in_array($mname, array('good', 'notice', 'album', 'consume', 'groupbuy')) && $_GET['shopid']) {
getpanelinfo($_GET['shopid']);
ssetcookie('shopid', $_GET['shopid'], 3600 * 10);
}
if (!ckfounder($_G['uid'])) {
if (!check_itemaccess($_GET['itemid'], $mname)) {
cpmsg('no_' . $mname . '_itemaccess', 'admin.php?action=list&m=' . $mname);
}
}
if (empty($_SGLOBAL['panelinfo']) && !empty($_REQUEST['shopid'])) {
getpanelinfo($_REQUEST['shopid']);
}
if (!empty($_POST['valuesubmit'])) {
$checkresults = array();
if ($mname == "notice" || $mname == "shop") {
//標題樣式
empty($_POST['strongsubject']) ? $_POST['strongsubject'] = '' : ($_POST['strongsubject'] = 1);
empty($_POST['underlinesubject']) ? $_POST['underlinesubject'] = '' : ($_POST['underlinesubject'] = 1);
示例9: realname_set
realname_set($value['authorid'], $value['author']);
//实名
$value['message'] = strip_tags($value['message']);
//剥去字符串中的 HTML 标签
$value['avatar_url'] = avatar($value['authorid'], 'middle', TRUE);
$list[] = $value;
}
}
//分页
$multi = multi($count, $perpage, $page, "space.php?uid={$bwzt['uid']}&do={$do}&id={$id}", '', 'content');
//访问统计
if (!$space['self'] && $_SCOOKIE['view_bwztid'] != $bwzt['bwztid']) {
$_SGLOBAL['db']->query("UPDATE " . tname('bwzt') . " SET viewnum=viewnum+1 WHERE bwztid='{$bwzt['bwztid']}'");
inserttable('log', array('id' => $space['uid'], 'idtype' => 'uid'));
//延迟更新
ssetcookie('view_bwztid', $bwzt['bwztid']);
}
//表态
$hash = md5($bwzt['uid'] . "\t" . $bwzt['dateline']);
$id = $bwzt['bwztid'];
$idtype = 'bwztid';
foreach ($clicks as $key => $value) {
$value['clicknum'] = $bwzt["click_{$key}"];
$value['bwztclassid'] = mt_rand(1, 4);
$value['bwztdivisionid'] = mt_rand(1, 4);
if ($value['clicknum'] > $maxclicknum) {
$maxclicknum = $value['clicknum'];
}
$clicks[$key] = $value;
}
//点评
示例10: isset
END;
}
}
} else {
$pid = isset($_GET['pid']) ? intval($_GET['pid']) : 0;
if ($pid && $avatarfeedstr && $updatetime < 86400) {
//验证用户是否有更新
$prelength = strlen($_SC['cookiepre']);
foreach ($_COOKIE as $key => $val) {
if (substr($key, 0, $prelength) == $_SC['cookiepre']) {
$_SCOOKIE[substr($key, $prelength)] = empty($magic_quote) ? saddslashes($val) : $val;
}
}
if (!isset($_SCOOKIE['viewuserid']) || !in_array($updateuid, explode(',', $_SCOOKIE['viewuserid']))) {
$_SCOOKIE['viewuserid'] = empty($_SCOOKIE['viewuserid']) ? $updateuid : $_SCOOKIE['viewuserid'] . ",{$updateuid}";
ssetcookie('viewuserid', $_SCOOKIE['viewuserid'], $_SGLOBAL['timestamp'] + 43200);
if (!empty($_GET['plugin'])) {
print <<<END
\$('authorfeed').innerHTML = '<span id="authornewfeed" onmouseover="showMenu(this.id);">有新动态</span>';
\$('authornewfeed_menu').innerHTML = '<div>{$avatarfeedstr}</div>';
END;
} else {
print <<<END
var authorPostonObj = \$('authorposton{$pid}');
if(authorPostonObj != null && typeof authorPostonObj == 'object') {
\tvar oSpan = document.createElement("span");
\toSpan.id = "authornewfeed"
\toSpan.innerHTML = "有新动态";
\toSpan.onmouseover = function(){showMenu(this.id);}
\tauthorPostonObj.parentNode.insertBefore(oSpan, authorPostonObj);
}
示例11: checkclose
echo "<br />";
echo "$filenameandpath";
echo "<br />";
echo "$filename";
echo "<br />";
*/
/* $IAUTH_SERVER_ROOT=substr(dirname(__FILE__),0,8); */
/* echo $IAUTH_SERVER_ROOT; */
/* chdir($IAUTH_SERVER_ROOT); */
/* print_r($_SERVER); */
/* chdir(dirname(__FILE__).'../../'); */
/* chdir("../../"); */
/* echo getcwd(); */
//include_once('common.php');
/* exit(); */
//header("location: ../../index.php");
//showmessage('aa');
//使用location函数比较难跳回来,或者是传些参数去用户客户端吧
include_once $_SERVER['DOCUMENT_ROOT'] . '/common.php';
/*
//是否关闭站点
checkclose();
*/
//简化supe_uid
$uid = $_SGLOBAL['supe_uid'];
//如果存在,则跳转到之前的那个文件
if (!$uid) {
ssetcookie('_refer', rawurlencode($_SERVER['REQUEST_URI']));
showmessage('to_login', 'http://' . $_SERVER['SERVER_NAME'] . '/do.php?ac=' . $_SCONFIG['login_action'], 0);
}
/* chdir(dirname(__FILE__)); */
示例12: showmessage
showmessage('magicuse_bad_object');
} elseif ($value['author'] == '') {
showmessage('magicuse_object_once_limit');
}
} else {
$query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('clickuser') . " WHERE id = '{$id}' AND idtype = '{$idtype}' AND uid = '{$_SGLOBAL['supe_uid']}'");
$value = $_SGLOBAL['db']->fetch_array($query);
if (empty($value)) {
showmessage('magicuse_bad_object');
} elseif ($value['username'] == '') {
showmessage('magicuse_object_once_limit');
}
}
//匿名卡
if (submitcheck("usesubmit")) {
$second = 1;
if ($idtype == 'uid') {
//空间脚印
ssetcookie('anonymous_visit_' . $_SGLOBAL['supe_uid'] . '_' . $id, '1');
updatetable('visitor', array('vusername' => ''), array('uid' => $id, 'vuid' => $_SGLOBAL['supe_uid']));
$second = 0;
} elseif ($idtype == 'cid') {
//评论/留言
updatetable('comment', array('author' => ''), array('cid' => $id, 'authorid' => $_SGLOBAL['supe_uid']));
} else {
//表态
updatetable('clickuser', array('username' => ''), array('id' => $id, 'idtype' => $idtype, 'uid' => $_SGLOBAL['supe_uid']));
}
magic_use($mid, array('id' => $id, 'idtype' => $idtype), true);
showmessage('magicuse_success', $_POST['refer'], $second);
}
示例13: switch
switch ($post['action']) {
case 'usecookie':
$si_string = '';
if (isset($_COOKIE['si_string'])) {
$si_string = explode("\t", authcode($_COOKIE['si_string']));
}
if (!!$si_string) {
list($email, $password) = $si_string;
}
case 'login':
if (!preg_match('#\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*#', $email)) {
$json->setMsg('invailed email');
break;
}
if ($remember) {
ssetcookie('si_string', authcode(implode("\t", [$email, $password]), 'ENCODE'));
}
$gamelogin = new kanlogin($email, $password, $lode_type, $remember);
$login_result = $gamelogin->login();
if ($login_result) {
$json->success();
}
break;
default:
$json->setMsg('watch your magic');
break;
}
} else {
$json->setMsg('watch your magic');
}
exit($json);
示例14: DB_Set_Logined
function DB_Set_Logined($uid)
{
global $db, $_SGLOBAL, $_SN;
// echo var_dump($_SN)."--_SN0<br>";
$setarr = array('uid' => $uid, 'username' => '', 'password' => '');
$query = $db->query("SELECT username,password FROM " . tname('member') . " WHERE uid='{$setarr['uid']}'");
if ($value = $db->fetch_array($query)) {
$setarr['username'] = addslashes($value['username']);
$setarr['password'] = addslashes($value['password']);
}
$invitearr = $_SESSION['invitearr'];
//从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取
$url_plus = $_SESSION['url_plus'];
//从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取
$app = $_SESSION['app'];
//从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取
$_SN = $_SESSION['SN'];
//从会话里取出后边要用的这个变量
// echo var_dump($invitearr)."--invitearr<br>";
// echo var_dump($url_plus)."--url_plus<br>";
// echo var_dump($app)."--app<br>";
// echo var_dump($_SN)."--_SN1<br>";
include_once S_ROOT . './source/function_space.php';
//开通空间
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('space') . " WHERE uid='{$setarr['uid']}'");
if (!($space = $_SGLOBAL['db']->fetch_array($query))) {
$space = space_open($setarr['uid'], $setarr['username'], 0, $passport['email']);
}
$_SGLOBAL['member'] = $space;
//实名
realname_set($space['uid'], $space['username'], $space['name'], $space['namestatus']);
//这里$_SN再次被赋值
// echo var_dump($_SN)."--_SN2<br>";
//设置cookie
ssetcookie('auth', authcode("{$setarr['password']}\t{$setarr['uid']}", 'ENCODE'), $cookietime);
ssetcookie('loginuser', $passport['username'], 31536000);
ssetcookie('_refer', '');
//同步登录
include_once S_ROOT . './uc_client/client.php';
$ucsynlogin = uc_user_synlogin($setarr['uid']);
// echo var_dump($ucsynlogin)."--ucsynlogin<br>";
//好友邀请
if ($invitearr) {
// echo $_SGLOBAL."--_SGLOBAL1<br>";
// echo var_dump($_SN)."--_SN1<br>";
// echo var_dump($invitearr['id'])."--invitearr['id']<br>";
// echo var_dump($setarr['uid'])."--setarr['uid']<br>";
// echo var_dump($setarr['username'])."--setarr['username']<br>";
// echo var_dump($invitearr['uid'])."--invitearr['uid']<br>";
// echo var_dump($invitearr['username'])."--invitearr['username']<br>";
//成为好友
invite_update($invitearr['id'], $setarr['uid'], $setarr['username'], $invitearr['uid'], $invitearr['username'], $app);
}
// echo var_dump($_SGLOBAL['supe_uid'])."--_SGLOBAL['supe_uid']<br>";
// echo var_dump($space['uid'])."--space['uid']<br>";
//判断用户是否设置了头像
$_SGLOBAL['supe_uid'] = $space['uid'];
$reward = $setarr = array();
$experience = $credit = 0;
$avatar_exists = ckavatar($space['uid']);
if ($avatar_exists) {
if (!$space['avatar']) {
//奖励积分
$reward = getreward('setavatar', 0);
$credit = $reward['credit'];
$experience = $reward['experience'];
if ($credit) {
$setarr['credit'] = "credit=credit+{$credit}";
}
if ($experience) {
$setarr['experience'] = "experience=experience+{$experience}";
}
$setarr['avatar'] = 'avatar=1';
$setarr['updatetime'] = "updatetime={$_SGLOBAL['timestamp']}";
}
} else {
if ($space['avatar']) {
$setarr['avatar'] = 'avatar=0';
}
}
if (empty($_POST['refer'])) {
$_POST['refer'] = 'space.php?do=home';
}
realname_get();
showmessage('login_success', $app ? "userapp.php?id={$app}" : $_POST['refer'], 1, array($ucsynlogin));
}
示例15: exit
<?php
if (!defined('iBUAA')) {
exit('Access Denied');
}
$user = $_SGLOBAL['db']->query("select usertype from " . tname(baseprofile) . " WHERE uid = " . $space[uid] . " and collegeid like '0%' LIMIT 1 ");
$usertype = $_SGLOBAL['db']->result($user);
ssetcookie('mytemplate', S_ROOT . './template/default/style.css', 3600 * 24 * 365);
//长期有效
//显示全站动态的好友数
if (empty($_SCONFIG['showallfriendnum']) || $_SCONFIG['showallfriendnum'] < 1) {
$_SCONFIG['showallfriendnum'] = 10;
}
//默认热点天数
if (empty($_SCONFIG['feedhotday'])) {
$_SCONFIG['feedhotday'] = 2;
}
//网站近况
$isnewer = $space['friendnum'] < $_SCONFIG['showallfriendnum'] ? 1 : 0;
if (empty($_GET['view']) && $space['self'] && $isnewer) {
$_GET['view'] = 'ours';
//默认显示
}
//分页
$perpage = $_SCONFIG['feedmaxnum'] < 50 ? 50 : $_SCONFIG['feedmaxnum'];
$perpage = mob_perpage($perpage);
if ($_GET['view'] == 'hot') {
$perpage = 50;
}
$start = empty($_GET['start']) ? 0 : intval($_GET['start']);
//检查开始数