当前位置: 首页>>代码示例>>PHP>>正文


PHP GetCookie函数代码示例

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


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

示例1: __construct

 function __construct($kptime = -1)
 {
     $this->keeptime = $kptime;
     $this->db = $GLOBALS['dsql'];
     $this->uid = $this->GetNum(GetCookie("UserId"));
     $this->username = GetCookie("UserName");
     $this->logintime = GetCookie("LoginTime");
 }
开发者ID:lz1988,项目名称:stourwebcms,代码行数:8,代码来源:member.class.php

示例2: ListAllType

 /**
  *  列出某一频道下的所有栏目
  *
  * @access    public
  * @param     string  $channel  频道ID
  * @return    void
  */
 function ListAllType($channel = 0)
 {
     global $cfg_admin_channel, $admin_catalogs, $targetid, $oldvalue;
     $oldvalues = array();
     if (!empty($oldvalue)) {
         $oldvalues = explode(',', $oldvalue);
     }
     //检测用户有权限的顶级栏目
     if ($cfg_admin_channel == 'array') {
         $admin_catalog = join(',', $admin_catalogs);
         $this->dsql->SetQuery("SELECT reid FROM `#@__arctype` WHERE id IN({$admin_catalog}) GROUP BY reid ");
         $this->dsql->Execute();
         $topidstr = '';
         while ($row = $this->dsql->GetObject()) {
             if ($row->reid == 0) {
                 continue;
             }
             $topidstr .= $topidstr == '' ? $row->reid : ',' . $row->reid;
         }
         $admin_catalog .= ',' . $topidstr;
         $admin_catalogs = explode(',', $admin_catalog);
         $admin_catalogs = array_unique($admin_catalogs);
     }
     $this->dsql->SetQuery("SELECT id,typedir,typename,ispart,channeltype FROM `#@__arctype` WHERE reid=0 ORDER BY sortrank");
     $this->dsql->Execute(0);
     $lastid = GetCookie('lastCidMenu');
     while ($row = $this->dsql->GetObject(0)) {
         if ($cfg_admin_channel == 'array' && !in_array($row->id, $admin_catalogs)) {
             continue;
         }
         $typeDir = $row->typedir;
         $typeName = $row->typename;
         $ispart = $row->ispart;
         $id = $row->id;
         $channeltype = $row->channeltype;
         $ischeck = in_array($id, $oldvalues) ? ' checked' : '';
         $chackRadio = "<input type='radio' name='seltypeid' value='{$id}' {$ischeck} />";
         if ($targetid == 'typeid2') {
             $chackRadio = "<input type='checkbox' name='seltypeid' id='seltypeid{$id}' value='{$id}' {$ischeck} />";
         }
         if (!empty($channel) && $channeltype != $channel || $ispart != 0) {
             $chackRadio = '';
         }
         $soncat = '';
         $this->LogicListAllSunType($id, $channel, $soncat);
         if ($chackRadio == '' && $soncat == '') {
             continue;
         }
         echo "<div class='quickselItem'>\r\n";
         echo "    <div class='topcat'>{$chackRadio}{$typeName}</div>\r\n";
         if ($soncat != '') {
             echo "    <div class='soncat'>{$soncat}</div>\r\n";
         }
         echo "</div>\r\n";
     }
 }
开发者ID:iabing,项目名称:mzzyc,代码行数:63,代码来源:typeunit.class.selector.php

示例3: ListAllType

 function ListAllType($channel = 0, $nowdir = 0)
 {
     global $cfg_admin_channel, $admin_catalogs;
     //检测用户有权限的顶级栏目
     if ($cfg_admin_channel == 'array') {
         $admin_catalog = join(',', $admin_catalogs);
         $this->dsql->SetQuery("Select reid From `#@__arctype` where id in({$admin_catalog}) group by reid ");
         $this->dsql->Execute();
         $topidstr = '';
         while ($row = $this->dsql->GetObject()) {
             if ($row->reid == 0) {
                 continue;
             }
             $topidstr .= $topidstr == '' ? $row->reid : ',' . $row->reid;
         }
         $admin_catalog .= ',' . $topidstr;
         $admin_catalogs = explode(',', $admin_catalog);
         $admin_catalogs = array_unique($admin_catalogs);
     }
     $this->dsql->SetQuery("Select id,typedir,typename,ispart,channeltype From `#@__arctype` where reid=0 order by sortrank");
     $this->dsql->Execute(0);
     $lastid = GetCookie('lastCidMenu');
     while ($row = $this->dsql->GetObject(0)) {
         if ($cfg_admin_channel == 'array' && !in_array($row->id, $admin_catalogs)) {
             continue;
         }
         $typeDir = $row->typedir;
         $typeName = $row->typename;
         $ispart = $row->ispart;
         $id = $row->id;
         $channeltype = $row->channeltype;
         //普通栏目
         if ($ispart == 0) {
             $smenu = " oncontextmenu=\"CommonMenu(event,this,{$id},'" . urlencode($typeName) . "')\"";
         } else {
             if ($ispart == 1) {
                 $smenu = " oncontextmenu=\"CommonMenuPart(event,this,{$id},'" . urlencode($typeName) . "')\"";
             } else {
                 continue;
                 $smenu = " oncontextmenu=\"JumpMenu(event,this,{$id},'" . urlencode($typeName) . "')\" ";
             }
         }
         echo "<dl class='topcc'>\r\n";
         echo "  <dd class='dlf'><img style='cursor:pointer' onClick=\"LoadSuns('suns{$id}',{$id});\" src='img/tree_explode.gif' width='11' height='11'></dd>\r\n";
         echo "  <dd class='dlr'><a href='catalog_do.php?cid=" . $id . "&dopost=listArchives'{$smenu}>" . $typeName . "</a></dd>\r\n";
         echo "</dl>\r\n";
         echo "<div id='suns" . $id . "' class='sunct'>";
         if ($lastid == $id || $cfg_admin_channel == 'array') {
             $this->LogicListAllSunType($id, " ");
         }
         echo "</div>\r\n";
     }
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:53,代码来源:typeunit.class.menu.php

示例4: CreateUserMenu

function CreateUserMenu()
{
    global $db, $language;
    $menu_base = array($language['header']['menu_home'] => 'index.php');
    $menu_guest = array($language['header']['menu_login'] => 'index.php?page=login', $language['header']['menu_register'] => 'index.php?page=register');
    $menu_user = array($language['header']['menu_profile'] => 'index.php?page=profile', $language['header']['menu_search'] => 'index.php?page=search', $language['header']['menu_logout'] => 'index.php?page=logout');
    if (!GetCookie('hbb')) {
        $menu = array_merge($menu_base, $menu_guest);
    } else {
        $menu = array_merge($menu_base, $menu_user);
    }
    return $menu;
}
开发者ID:ChampaWasTaken,项目名称:HyperBB,代码行数:13,代码来源:menu.php

示例5: addonlinefile

function addonlinefile($offset, $uid)
{
    global $windid, $groupid, $lastvisit, $timestamp, $onlineip, $db_onlinetime, $fid, $tid, $wind_in, $tdtime, $db_olsize, $db_today;
    if (strlen($fid) > 4) {
        $fidwt = '';
    } else {
        $fidwt = $fid;
    }
    if (strlen($tid) > 7) {
        $tidwt = '';
    } else {
        $tidwt = $tid;
    }
    $wherebbsyou = getuseraction($fid, $wind_in);
    $acttime = get_date($timestamp, 'm-d H:i');
    $D_name = "data/bbscache/online.php";
    if (!file_exists(D_P . $D_name)) {
        pwCache::writeover(D_P . $D_name, str_pad("<?php die;?>", 96) . "\n");
    }
    if (GetCookie('hideid') != 1) {
        $newonline = "{$windid}\t{$timestamp}\t{$onlineip}\t{$fidwt}\t{$tidwt}\t{$groupid}\t{$wherebbsyou}\t{$acttime}\t{$uid}\t";
        $newonline = str_pad($newonline, $db_olsize) . "\n";
        if (checkinline(D_P . $D_name, $offset, $windid)) {
            $isModify = 0;
            writeinline(D_P . $D_name, $newonline, $offset);
        } else {
            list($offset, $isModify) = GetInsertOffset(D_P . $D_name);
            writeinline(D_P . $D_name, $newonline, $offset);
        }
        if ($db_today && $timestamp - $lastvisit > $db_onlinetime) {
            require_once R_P . 'require/today.php';
        }
    } elseif (GetCookie('hideid') == 1) {
        require_once R_P . 'require/hidden.php';
    }
    if ($isModify === 1) {
        //频度可控制性
        ModifySelectFile(D_P . "data/bbscache/guest.php");
    }
    return array($offset, $isModify);
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:41,代码来源:userglobal.php

示例6: forumcheck

 function forumcheck($user, $groupid)
 {
     if ($this->foruminfo['f_type'] == 'former' && $groupid == 'guest' && $_COOKIE) {
         Showmsg('forum_former');
     }
     $pwdcheck = GetCookie('pwdcheck');
     if ($this->foruminfo['password'] != '' && ($groupid == 'guest' || $pwdcheck[$this->fid] != $this->foruminfo['password'] && !S::inArray($user['username'], $GLOBALS['manager']))) {
         require_once R_P . 'require/forumpassword.php';
     }
     if (!$this->allowvisit($user, $groupid)) {
         Showmsg('forum_jiami');
     }
     if (!$this->foruminfo['cms'] && $this->foruminfo['f_type'] == 'hidden' && !$this->foruminfo['allowvisit']) {
         Showmsg('forum_hidden');
     }
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:16,代码来源:forum.class.php

示例7: PassportUserdb

/**
*取得用户数据
**/
function PassportUserdb()
{
    global $db, $timestamp, $webdb, $onlineip, $TB, $pre, $db_ifsafecv, $userDB;
    list($lfjuid, $lfjpwd, $safecv) = explode("\t", StrCode(GetCookie('winduser'), 'DECODE'));
    if (!$lfjuid || !$lfjpwd) {
        return '';
    }
    if ($db_ifsafecv) {
        $SQL = ",M.safecv";
    }
    $detail = $userDB->get_allInfo($lfjuid);
    if (PwdCode($detail[password]) != $lfjpwd || $db_ifsafecv && $safecv != $detail['safecv']) {
        return;
    }
    return $detail;
}
开发者ID:GHubgenius,项目名称:qbbj,代码行数:19,代码来源:pwbbs5.php

示例8: forumcheck

 function forumcheck($user, $groupid)
 {
     if ($this->foruminfo['f_type'] == 'former' && $groupid == 'guest' && $_COOKIE) {
         Showmsg('forum_former');
     }
     if (!empty($this->foruminfo['style']) && file_exists(D_P . "data/style/{$this->foruminfo[style]}.php")) {
         $GLOBALS['skin'] = $this->foruminfo['style'];
     }
     $pwdcheck = GetCookie('pwdcheck');
     if ($this->foruminfo['password'] != '' && ($groupid == 'guest' || $pwdcheck[$this->fid] != $this->foruminfo['password'] && !CkInArray($user['username'], $GLOBALS['manager']))) {
         require_once R_P . 'require/forumpw.php';
     }
     if (!$this->allowvisit($user, $groupid)) {
         Showmsg('forum_jiami');
     }
     if (!$this->foruminfo['cms'] && $this->foruminfo['f_type'] == 'hidden' && !$this->foruminfo['allowvisit']) {
         Showmsg('forum_hidden');
     }
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:19,代码来源:forum.class.php

示例9: wind_forumcheck

function wind_forumcheck($forum)
{
    global $windid, $groupid, $tid, $fid, $skin, $winddb, $manager;
    if ($forum['f_type'] == 'former' && $groupid == 'guest' && $_COOKIE) {
        Showmsg('forum_former');
    }
    if (!empty($forum['style']) && file_exists(D_P . "data/style/{$forum['style']}.php")) {
        $skin = $forum['style'];
    }
    $pwdcheck = GetCookie('pwdcheck');
    if ($forum['password'] != '' && ($groupid == 'guest' || $pwdcheck[$fid] != $forum['password'] && !CkInArray($windid, $manager))) {
        require_once R_P . 'require/forumpw.php';
    }
    if ($forum['allowvisit'] && !allowcheck($forum['allowvisit'], $groupid, $winddb['groups'], $fid, $winddb['visit'])) {
        Showmsg('forum_jiami');
    }
    if (!$forum['cms'] && $forum['f_type'] == 'hidden' && !$forum['allowvisit']) {
        Showmsg('forum_hidden');
    }
}
开发者ID:adi00,项目名称:wumaproject,代码行数:20,代码来源:forum.php

示例10: ListAllType

	function ListAllType($nowdir=0,$issend=-1,$opall=false,$channelid=0)
	{
		if(!is_object($this->dsql)){ $this->dsql = new DedeSql(false); }

		$this->dsql->SetQuery("Select ID,typedir,typename,ispart,channeltype,issend From #@__arctype where reID=0 order by sortrank");
		$this->dsql->Execute(0);
		$lastID = GetCookie('lastCidTree');
		while($row=$this->dsql->GetObject(0))
		{
			$typeDir = $row->typedir;
			$typeName = $row->typename;
			$ispart = $row->ispart;
			$ID = $row->ID;
			$dcid = $row->channeltype;
			$dissend = $row->issend;
			if($ispart>=2||TestHasChannel($ID,$channelid,$issend)==0) continue;
			if($ispart==0 || ($ispart==1 && $opall))
			{//普通列表
				if(($channelid==0 || $channelid==$dcid) 
				&& ($issend!=1 || $dissend==1))
				{
					$smenu = " <input type='checkbox' name='selid' id='selid$ID' class='np' onClick=\"ReSel($ID,'$typeName')\"> ";
				}else{
					$smenu = "[×]";
				}
			}else if($ispart==1)
			{//带封面的频道
				$smenu = "[封面]";
			}
			echo "<dl class='topcc'>\n";
			echo "<dd><img style='cursor:hand' onClick=\"LoadSuns('suns{$ID}',{$ID},{$channelid});\" src='img/tree_explode.gif' width='11' height='11'> $typeName{$smenu}</dd>\n";
			echo "</dl>\n";
			echo "<div id='suns".$ID."' class='sunct'>";
			if($lastID==$ID){
			   $this->LogicListAllSunType($ID,"  ",$opall,$issend,$channelid);
			}
			echo "</div>\r\n";
		}
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:39,代码来源:inc_type_tree_member.php

示例11: Loginout

function Loginout()
{
    global $db, $timestamp, $db_onlinetime, $groupid, $windid, $winduid, $db_ckpath, $db_ckdomain, $db_online;
    $thisvisit = $timestamp - $db_onlinetime * 1.5;
    $db->update('UPDATE pw_memberdata SET thisvisit=' . pwEscape($thisvisit) . ' WHERE uid=' . pwEscape($winduid));
    /*update cache*/
    $_cache = getDatastore();
    $_cache->delete("UID_" . $winduid);
    list($db_ckpath, $db_ckdomain) = explode("\t", GetCookie('ck_info'));
    Cookie('winduser', '', 0);
    Cookie('hideid', '', 0);
    Cookie('lastvisit', '', 0);
    $pwdcheck = GetCookie('pwdcheck');
    if (is_array($pwdcheck)) {
        foreach ($pwdcheck as $key => $value) {
            Cookie("pwdcheck[{$key}]", '', 0);
        }
    }
    Cookie('ck_info', '', 0);
    Cookie('msghide', '', 0, false);
    $windid = $winduid = '';
}
开发者ID:adi00,项目名称:wumaproject,代码行数:22,代码来源:checkpass.php

示例12: Loginout

function Loginout()
{
    global $db, $timestamp, $db_onlinetime, $groupid, $windid, $winduid, $db_ckpath, $db_ckdomain, $db_online;
    $thisvisit = $timestamp - $db_onlinetime * 1.5;
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    $userService->update($winduid, array(), array('thisvisit' => $thisvisit));
    /*update cache*/
    //* $_cache = getDatastore();
    //* $_cache->delete("UID_".$winduid);
    list($db_ckpath, $db_ckdomain) = explode("\t", GetCookie('ck_info'));
    Cookie('winduser', '', 0);
    Cookie('hideid', '', 0);
    Cookie('lastvisit', '', 0);
    $pwdcheck = GetCookie('pwdcheck');
    if (is_array($pwdcheck)) {
        foreach ($pwdcheck as $key => $value) {
            Cookie("pwdcheck[{$key}]", '', 0);
        }
    }
    Cookie('ck_info', '', 0);
    Cookie('msghide', '', 0, false);
    $windid = $winduid = '';
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:24,代码来源:checkpass.php

示例13: list

        list(, $userinbbs, $guestinbbs) = $online_info;
    } else {
        $onlineService = L::loadClass('OnlineService', 'user');
        $userinbbs = $onlineService->countOnlineUser();
        $guestinbbs = $onlineService->countOnlineGuest();
        Cookie('online_info', $timestamp . "\t" . $userinbbs . "\t" . $guestinbbs);
    }
}
if ($last_statistictime == 0 || get_date($timestamp, 'G') - get_date($last_statistictime, 'G') > 1 || $timestamp - $last_statistictime > 3600) {
    $stasticsService = L::loadClass('Statistics', 'datanalyse');
    $stasticsService->updateOnlineInfo();
}
$usertotal = $guestinbbs + $userinbbs;
if ($db_indexonline) {
    S::gp(array('online'));
    empty($online) && ($online = GetCookie('online'));
    if ($online == 'yes') {
        if ($usertotal > 2000 && !S::inArray($windid, $manager)) {
            //$online = 'no';
            Cookie('online', 'no');
        } else {
            $index_whosonline = '';
            $db_online = intval($db_online);
            Cookie('online', $online);
            include_once S::escapePath(R_P . "require/online_{$db_online}.php");
        }
    }
    if ($online == 'no') {
        Cookie('online', 'no');
    }
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:index.php

示例14: exit

<?php

!function_exists('readover') && exit('Forbidden');
/*The app client*/
if ($db_siteappkey && ($db_apps_list['17']['status'] == 1 || is_array($db_threadconfig))) {
    $appclient = L::loadClass('appclient');
    if (is_array($db_threadconfig)) {
        $threadright = array();
        $threadright = $appclient->getThreadRight();
    }
}
/*The app client*/
$newpic = (int) GetCookie('newpic');
$query = $db->query("SELECT f.fid,f.logo,f.name, f.descrip,f.forumadmin,f.password,f.allowvisit,f.f_type,f.ifcms,fd.tpost,fd.topic,fd.article,fd.subtopic,fd.lastpost FROM pw_forums f LEFT JOIN pw_forumdata fd USING(fid) WHERE f.fup=" . S::sqlEscape($fid) . "ORDER BY f.vieworder");
while ($child = $db->fetch_array($query)) {
    if (empty($child['allowvisit']) || strpos($child['allowvisit'], ',' . $groupid . ',') !== false) {
        list($f_a, $child['au'], $f_c, $child['ft']) = explode("\t", $child['lastpost']);
        $child['pic'] = $newpic < $f_c && $f_c + 172800 > $timestamp ? 'new' : 'old';
        $child['newtitle'] = get_date($f_c);
        $child['t'] = substrs($f_a, 21);
    } else {
        if ($child['f_type'] === 'hidden') {
            continue;
        }
        $child['pic'] = "lock";
    }
    $child['topics'] = $child['topic'] + $child['subtopic'];
    if ($db_indexfmlogo == 1 && file_exists("{$imgdir}/{$stylepath}/forumlogo/{$child['fid']}.gif")) {
        $child['logo'] = "{$imgpath}/{$stylepath}/forumlogo/{$child['fid']}.gif";
    } elseif ($db_indexfmlogo == 2) {
        if (!empty($child['logo']) && strpos($child['logo'], 'http://') === false) {
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:thread_child.php

示例15: Showmsg

            } else {
                Showmsg('ban_info2');
            }
        }
    }
}
if (GetCookie('force') && $winduid != GetCookie('force')) {
    $force = GetCookie('force');
    $bandb = $db->get_one('SELECT type FROM pw_banuser WHERE uid=' . pwEscape($force) . ' AND fid=0');
    if ($bandb['type'] == 3) {
        Showmsg('ban_info3');
    } else {
        Cookie('force', '', 0);
    }
}
$userlastptime = $groupid != 'guest' ? $winddb['lastpost'] : GetCookie('userlastptime');
$tdtime >= $winddb['lastpost'] && ($winddb['todaypost'] = 0);
$montime >= $winddb['lastpost'] && ($winddb['monthpost'] = 0);
if ($_G['postlimit'] && $winddb['todaypost'] >= $_G['postlimit']) {
    Showmsg('post_gp_limit');
}
list(, , $postq) = explode("\t", $db_qcheck);
InitGP(array('action'));
if ($action == 'modify') {
    InitGP(array('pid', 'article'));
    require_once R_P . 'lib/postmodify.class.php';
    if ($pid && is_numeric($pid)) {
        $postmodify = new replyModify($tid, $pid, $pwpost);
    } else {
        $postmodify = new topicModify($tid, 0, $pwpost);
    }
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:ajax.php


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