• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP fSetCookie函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中fSetCookie函数的典型用法代码示例。如果您正苦于以下问题:PHP fSetCookie函数的具体用法?PHP fSetCookie怎么用?PHP fSetCookie使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了fSetCookie函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: photo

 public function photo()
 {
     global $_FANWE;
     if ($_FANWE['uid'] == 0) {
         $redir_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
         fSetCookie('redir_url', $redir_url, time() + 3600);
         require_once fimport('dynamic/user');
         include template('page/user/user_login');
     } else {
         FanweService::instance()->cache->loadCache('albums');
         $imgs = $_FANWE['request']['imgUrl'];
         $pageUrl = $_FANWE['request']['pageUrl'];
         $img_list = explode(",", $imgs);
         $count_img = count($img_list);
         $videos = $_FANWE['request']['videoUrl'];
         $video_list = explode(",", $videos);
         $count_video = count($video_list);
         if ($_FANWE['request']['showType'] == 1) {
             include template("page/collection/collection_photos");
         } else {
             include template("page/collection/collection_photo");
         }
     }
     display();
 }
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:25,代码来源:collection.module.php


示例2: getQqLoginUrl

function getQqLoginUrl($appid)
{
    global $_FANWE;
    $state = md5(uniqid(rand(), TRUE));
    $url = "https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=" . $appid . "&redirect_uri=" . urlencode($_FANWE['site_url'] . "callback/qq.php") . "&state=" . $state . "&scope=" . QQ_SCOPE;
    fSetCookie('qq_state', $state);
    return $url;
}
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:8,代码来源:qq.func.php


示例3: jump

 private function jump()
 {
     global $_FANWE;
     OpenSDK_Tencent_Weibo::init($this->config['app_key'], $this->config['app_secret']);
     $request_token = OpenSDK_Tencent_Weibo::getRequestToken($_FANWE['site_url'] . "callback/tqq.php");
     $url = OpenSDK_Tencent_Weibo::getAuthorizeURL($request_token);
     fSetCookie('login_oauth', authcode(serialize($request_token), 'ENCODE'));
     $url = FU('tgo', array('url' => $url));
     fHeader("location:" . $url);
 }
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:10,代码来源:tqq.php


示例4: bindJump

 public function bindJump()
 {
     global $_FANWE;
     if ($_FANWE['uid'] == 0) {
         $this->loginJump();
         exit;
     }
     fSetCookie('callback_type', 'bind');
     $this->jump();
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:10,代码来源:qq.php


示例5: jump

 private function jump()
 {
     global $_FANWE;
     $oauth = new WeiboOAuth($this->config['app_key'], $this->config['app_secret']);
     $keys = $oauth->getRequestToken();
     $url = $oauth->getAuthorizeURL($keys['oauth_token'], false, $_FANWE['site_url'] . "callback/sina.php");
     $url = FU('tgo', array('url' => $url));
     fSetCookie('login_oauth', authcode(serialize($keys), 'ENCODE', $_FANWE['authkey']));
     fHeader("location:" . $url);
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:10,代码来源:sina.php


示例6: jumpUserBindReg

 public function jumpUserBindReg($data, $user_name)
 {
     do {
         $max_count = FDB::resultFirst('SELECT COUNT(*) FROM ' . FDB::table("user") . " WHERE user_name = '" . $user_name . "'");
         if ($max_count > 0) {
             $user_name = $user_name . '_' . random(3);
         }
     } while ($max_count > 0);
     $data['user_name'] = $user_name;
     $data = serialize($data);
     fSetCookie('bind_user_info', authcode($data, 'ENCODE'));
     fHeader("location:" . FU('user/bind'));
 }
开发者ID:yakrsa,项目名称:football,代码行数:13,代码来源:userbase.class.php


示例7: bindHandler

 public function bindHandler($user)
 {
     global $_FANWE;
     if ($_FANWE['uid'] == 0) {
         exit;
     }
     $bind_user = $this->getUserByTypeKeyId($this->type, $user['id']);
     if ($bind_user && $bind_user['uid'] != $_FANWE['uid']) {
         $data = array();
         $data['short_name'] = $this->config['short_name'];
         $data['keyid'] = $user['id'];
         $data['type'] = $this->type;
         $data['user'] = $user;
         fSetCookie('sync_bind_exists', authcode(serialize($data), 'ENCODE'));
     } else {
         $this->bindUser($user);
     }
 }
开发者ID:yakrsa,项目名称:football,代码行数:18,代码来源:douban.class.php


示例8: bindHandler

 public function bindHandler($parameters, $session)
 {
     global $_FANWE;
     if ($_FANWE['uid'] == 0) {
         exit;
     }
     $user = $this->getUserInfo($parameters['visitor_nick'], $session);
     $bind_user = $this->getUserByTypeKeyId($this->type, $user['user_id']);
     if ($bind_user && $bind_user['uid'] != $_FANWE['uid']) {
         $data = array();
         $data['type'] = $this->type;
         $data['keyid'] = $user['user_id'];
         $data['short_name'] = $this->config['short_name'];
         $data['user'] = $user;
         $data['parameters'] = $parameters;
         $data['session'] = $session;
         fSetCookie('sync_bind_exists', authcode(serialize($data), 'ENCODE'));
     } else {
         $this->bindUser($user, $parameters, $session);
     }
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:21,代码来源:taobao.class.php


示例9: verify

 public function verify()
 {
     global $_FANWE;
     $seccode = random(6, 1);
     $seccodeunits = '';
     $s = sprintf('%04s', base_convert($seccode, 10, 24));
     $seccodeunits = 'BCEFGHJKMPQRTVWXY2346789';
     $seccode = '';
     for ($i = 0; $i < 4; $i++) {
         $unit = ord($s[$i]);
         $seccode .= $unit >= 0x30 && $unit <= 0x39 ? $seccodeunits[$unit - 0x30] : $seccodeunits[$unit - 0x57];
     }
     $rhash = $_FANWE['request']['rhash'];
     fSetCookie('verify' . $rhash, authcode(strtoupper($seccode) . "\t" . (TIME_UTC - 180) . "\t" . $rhash . "\t" . FORM_HASH, 'ENCODE', $_FANWE['config']['security']['authkey']), 0, 1, true);
     @header("Expires: -1");
     @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
     @header("Pragma: no-cache");
     require fimport('class/verify');
     $verify = new Verify();
     $verify->code = $seccode;
     $verify->width = 100;
     $verify->height = 36;
     $verify->display();
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:24,代码来源:misc.module.php


示例10: bindBuyerVerifier

 public function bindBuyerVerifier()
 {
     global $_FANWE;
     require_once FANWE_ROOT . "sdks/taobao/taobao.func.php";
     $uid = $_FANWE['uid'];
     $data['is_buyer'] = 0;
     FDB::update('user', $data, "uid = {$uid}");
     FanweService::instance()->cache->loadCache('logins');
     $url = GetTaoBaoLoginUrl($_FANWE['cache']['logins']['taobao']['app_key']);
     $url = FU('tgo', array('url' => $url));
     fSetCookie('callback_type', 'buyer');
     fHeader("location:" . $url);
 }
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:13,代码来源:settings.module.php


示例11: fHeader

/**
 * 页面跳转
 * @param string $string
 * @param bool $replace
 * @param int $http_response_code
 * @return void
 */
function fHeader($string, $replace = true, $http_response_code = 0)
{
    global $_FANWE;
    $string = str_replace(array("\r", "\n"), array('', ''), $string);
    $reg = '/location:\\s?' . preg_quote($_FANWE['site_root'], '/') . '/i';
    $string = preg_replace($reg, 'Location: ' . $_FANWE['site_url'], $string);
    if (strpos($string, $_FANWE['site_url'])) {
        fSetCookie('from_heade', authcode(TIME_UTC, 'ENCODE'));
    }
    if (empty($http_response_code) || PHP_VERSION < '4.3') {
        @header($string, $replace);
    } else {
        @header($string, $replace, $http_response_code);
    }
    if (preg_match('/^\\s*location:/is', $string)) {
        exit;
    }
}
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:25,代码来源:global.func.php


示例12: getQqAccessToken

<?php

include "base.php";
require_once FANWE_ROOT . "sdks/qq/qq.func.php";
$appid = $_FANWE['cache']['logins']['qq']['app_key'];
$appkey = $_FANWE['cache']['logins']['qq']['app_secret'];
$access_token = getQqAccessToken($appid, $appkey);
$openid = getQqOpenid($access_token);
require_once FANWE_ROOT . "core/class/user/qq.class.php";
$qq = new QqUser();
switch ($callback_type) {
    case 'login':
        $qq->loginHandler($access_token, $openid);
        $url = FU('u/index');
        break;
    case 'bind':
        $qq->bindHandler($access_token, $openid);
        $url = FU('settings/bind');
        break;
}
fSetCookie('callback_type', '');
fHeader("location:" . $url);
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:22,代码来源:qq.php


示例13: array_keys

}
?>
<script type="text/javascript">
var USER_ID = <?php 
echo $_FANWE['uid'];
?>
;
var URL_MODEL = "<?php 
echo $_FANWE['setting']['url_model'];
?>
";
var DOMAIN = "<?php 
echo $_FANWE['domain'];
?>
";
<?php 
if (!empty($_FANWE['authoritys'])) {
    $manages = array_keys($_FANWE['authoritys']);
    $manages = implode(',', $manages);
}
?>
var MANAGES = "<?php 
echo $manages;
?>
";
</script>
<?php 
if (!empty($_FANWE['cookie']['dynamic_script'])) {
    echo stripslashes($_FANWE['cookie']['dynamic_script']);
    fSetCookie('dynamic_script', '');
}
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:31,代码来源:inc_script.tpl.php


示例14: logout

 public function logout()
 {
     global $_FANWE;
     $_FANWE['nav_title'] = lang('common', 'user_logout');
     FS('User')->clearSession();
     //====add by chenfq 2011-10-14=========
     $syslogout_js = FS("Integrate")->synLogout();
     //js 需要在前台执行
     //echo $syslogout_js; exit;
     if (!empty($syslogout_js)) {
         fSetCookie("dynamic_script", $syslogout_js);
     }
     fHeader("location: " . FU('index/index'));
 }
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:14,代码来源:user.module.php


示例15: unserialize

<?php

include "base.php";
$login_oauth = unserialize(authcode($_FANWE['cookie']['login_oauth'], 'DECODE'));
if (empty($login_oauth)) {
    exit;
}
$oauth_token = $_REQUEST['oauth_token'];
$oauth_verifier = $_REQUEST['oauth_verifier'];
if (empty($oauth_token) || empty($oauth_verifier)) {
    exit;
}
$_FANWE['login_oauth']['tqq'] = $login_oauth;
require_once FANWE_ROOT . "core/class/user/tqq.class.php";
$tqq = new TqqUser();
if (!OpenSDK_Tencent_Weibo::getAccessToken($oauth_verifier)) {
    exit;
}
switch ($callback_type) {
    case 'login':
        $tqq->loginHandler();
        $url = FU('u/index');
        break;
    case 'bind':
        $tqq->bindHandler();
        $url = FU('settings/bind');
        break;
}
fSetCookie('callback_type', '');
fSetCookie('login_oauth', '');
fHeader("location:" . $url);
开发者ID:dalinhuang,项目名称:concourse,代码行数:31,代码来源:tqq.php


示例16: getReferrals

 public function getReferrals()
 {
     global $_FANWE;
     if ($_FANWE['cookie']['referrals_uid']) {
         $uid = (int) authcode($_FANWE['cookie']['referrals_uid'], 'DECODE');
         if ($uid > 0) {
             if (FDB::resultFirst('SELECT COUNT(uid) FROM ' . FDB::table('user') . ' WHERE uid = ' . $uid) > 0) {
                 return $uid;
             } else {
                 fSetCookie('referrals_uid', 0, -1);
             }
         }
     }
     return 0;
 }
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:15,代码来源:user.service.php


示例17: array

<?php

$sync_bind_exists = $_FANWE['cookie']['sync_bind_exists'];
$result = array();
if (empty($sync_bind_exists)) {
    $result['status'] = 0;
    outputJson($result);
}
$sync_bind_exists = unserialize(authcode($sync_bind_exists, 'DECODE'));
$is_bind = $_FANWE['request']['is_bind'];
if ($is_bind) {
    $avatar = '';
    $type = $sync_bind_exists['type'];
    $keyid = $sync_bind_exists['keyid'];
    FDB::delete('user_bind', "type = '" . $type . "' AND keyid = '" . $keyid . "'");
    require_once FANWE_ROOT . "core/class/user/" . $type . ".class.php";
    $class = ucfirst($type) . 'User';
    $class = new $class();
    $class->bindByData($sync_bind_exists);
    $result['status'] = 1;
} else {
    $result['status'] = 0;
}
fSetCookie('sync_bind_exists', '');
outputJson($result);
开发者ID:dalinhuang,项目名称:concourse,代码行数:25,代码来源:bind.php


示例18: buildUser

 public function buildUser($uid)
 {
     if ($this->is_user) {
         if ($auth = $this->var['cookie']['auth']) {
             $auth = fAddslashes(explode("\t", authcode($auth, 'DECODE')));
         }
         list($password, $uid) = empty($auth) || count($auth) < 2 ? array('', '') : $auth;
         if ($uid) {
             $user = FS('user')->getUserById($uid);
         }
         if (!empty($user) && $user['password'] == $password) {
             $this->var['user'] = $user;
             $this->var['authoritys'] = FS('User')->getAuthoritys($uid);
             FS('User')->init($user);
         } else {
             $this->buildGuest();
         }
     } else {
         $this->buildGuest();
     }
     if (empty($this->var['cookie']['last_visit'])) {
         $this->var['user']['last_visit'] = TIME_UTC - 3600;
         fSetCookie('last_visit', TIME_UTC - 3600, 86400 * 30);
     } else {
         $this->var['user']['last_visit'] = $this->var['cookie']['last_visit'];
     }
     $this->var['uid'] = $this->var['user']['uid'];
     $this->var['user_name'] = addslashes($this->var['user']['user_name']);
     $this->var['gid'] = $this->var['user']['gid'];
     FS('User')->setReferrals();
 }
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:31,代码来源:fanwe.service.php


示例19: update

 function update()
 {
     if ($this->sid !== NULL) {
         $data = fAddslashes($this->var);
         if ($this->is_new) {
             $this->delete();
             FDB::insert('sessions', $data, false, false, true);
         } else {
             FDB::update('sessions', $data, "sid='{$data['sid']}'");
         }
         fSetCookie('sid', $this->sid, 86400);
     }
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:13,代码来源:session.class.php


示例20: exit

    exit('Access Denied');
}
global $_FANWE;
if (is_string($this->config['security']['attack_evasive'])) {
    $attackevasive_tmp = explode('|', $this->config['security']['attack_evasive']);
    $attackevasive = 0;
    foreach ($attackevasive_tmp as $key => $value) {
        $attackevasive += intval($value);
    }
    unset($attackevasive_tmp);
} else {
    $attackevasive = $this->config['security']['attack_evasive'];
}
$last_request = isset($_FANWE['cookie']['last_request']) ? authcode($_FANWE['cookie']['last_request'], 'DECODE') : '';
if ($attackevasive & 1 || $attackevasive & 4) {
    fSetCookie('last_request', authcode(TIME_UTC, 'ENCODE'), TIME_UTC + 816400, 1, true);
}
if ($attackevasive & 1) {
    if (TIME_UTC - $last_request < 1) {
        securityMessage(lang('common', 'attackevasive_1_subject'), lang('common', 'attackevasive_1_message'));
    }
}
if ($attackevasive & 2 && ($_SERVER['HTTP_X_FORWARDED_FOR'] || $_SERVER['HTTP_VIA'] || $_SERVER['HTTP_PROXY_CONNECTION'] || $_SERVER['HTTP_USER_AGENT_VIA'] || $_SERVER['HTTP_CACHE_INFO'] || $_SERVER['HTTP_PROXY_CONNECTION'])) {
    securityMessage(lang('common', 'attackevasive_2_subject'), lang('common', 'attackevasive_2_message'), FALSE);
}
if ($attackevasive & 4) {
    if (empty($last_request) || TIME_UTC - $last_request > 300) {
        securityMessage(lang('common', 'attackevasive_4_subject'), lang('common', 'attackevasive_4_message'));
    }
}
function securityMessage($subject, $message, $reload = TRUE)
开发者ID:dalinhuang,项目名称:concourse,代码行数:31,代码来源:security.inc.php



注:本文中的fSetCookie函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fText函数代码示例发布时间:2022-05-15
下一篇:
PHP fRp函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap