本文整理汇总了PHP中PutCookie函数的典型用法代码示例。如果您正苦于以下问题:PHP PutCookie函数的具体用法?PHP PutCookie怎么用?PHP PutCookie使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PutCookie函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
$gurl = 'article_edit.php';
}
header("location:{$gurl}?aid={$aid}");
exit;
} else {
if ($dopost == "viewArchives") {
$aid = preg_replace("#[^0-9]#", '', $aid);
//获取主表信息
$query = "SELECT arc.*,ch.maintable,ch.addtable,ch.issystem,ch.editcon,\n tp.typedir,tp.typename,tp.corank,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.sitepath,tp.siteurl\n FROM `#@__arctiny` arc\n LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid\n LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype\n WHERE arc.id='{$aid}' ";
$trow = $dsql->GetOne($query);
$trow['maintable'] = trim($trow['maintable']) == '' ? '#@__archives' : trim($trow['maintable']);
if ($trow['issystem'] != -1) {
$arcQuery = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.sitepath,tp.siteurl\n FROM `{$trow['maintable']}` arc LEFT JOIN `#@__arctype` tp on arc.typeid=tp.id\n LEFT JOIN `#@__channeltype` ch on ch.id=arc.channel WHERE arc.id='{$aid}' ";
$arcRow = $dsql->GetOne($arcQuery);
PutCookie('DedeUserID', $arcRow['mid'], 1800);
PutCookie('DedeLoginTime', time(), 1800);
if ($arcRow['ismake'] == -1 || $arcRow['corank'] != 0 || $arcRow['arcrank'] != 0 || $arcRow['typeid'] == 0 && $arcRow['channel'] != -1 || $arcRow['money'] > 0) {
echo "<script language='javascript'>location.href='{$cfg_phpurl}/view.php?aid={$aid}';</script>";
exit;
}
} else {
$arcRow['id'] = $aid;
$arcRow['typeid'] = $trow['typeid'];
$arcRow['senddate'] = $trow['senddate'];
$arcRow['title'] = '';
$arcRow['ismake'] = 1;
$arcRow['arcrank'] = $trow['corank'];
$arcRow['namerule'] = $trow['namerule'];
$arcRow['typedir'] = $trow['typedir'];
$arcRow['money'] = 0;
$arcRow['filename'] = '';
示例2: header
if ($dopost == "GetJs") {
header("location:makehtml_js.php");
exit;
} else {
if ($dopost == "GetSunListsMenu") {
$userChannel = $cuserLogin->getUserChannel();
require_once DEDEINC . "/typeunit.class.menu.php";
AjaxHead();
PutCookie('lastCidMenu', $cid, 3600 * 24, "/");
$tu = new TypeUnit($userChannel);
$tu->LogicListAllSunType($cid, " ");
} else {
if ($dopost == "GetSunLists") {
require_once DEDEINC . "/typeunit.class.admin.php";
AjaxHead();
PutCookie('lastCid', $cid, 3600 * 24, "/");
$tu = new TypeUnit();
$tu->dsql = $dsql;
echo " <table width='100%' border='0' cellspacing='0' cellpadding='0'>\r\n";
$tu->LogicListAllSunType($cid, " ");
echo " </table>\r\n";
$tu->Close();
} else {
if ($dopost == 'unitCatalog') {
CheckPurview('t_Move');
require_once DEDEINC . '/oxwindow.class.php';
require_once DEDEINC . '/typelink.class.php';
require_once DEDEINC . '/channelunit.func.php';
if (empty($nextjob)) {
$typeid = isset($typeid) ? intval($typeid) : 0;
$row = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__arctype` WHERE reid='{$typeid}' ");
示例3: empty
}
}
}
$myrow['content'] = empty($myrow['content']) ? " " : $myrow['content'];
//读取频道模型信息
$channelid = $myrow['channeltype'];
$dsql->SetQuery("SELECT id,typename,nid FROM `#@__channeltype` WHERE id<>-1 AND isshow=1 ORDER BY id");
$dsql->Execute();
while ($row = $dsql->GetObject()) {
$channelArray[$row->id]['typename'] = $row->typename;
$channelArray[$row->id]['nid'] = $row->nid;
if ($row->id == $channelid) {
$nid = $row->nid;
}
}
PutCookie('lastCid', GetTopid($id), 3600 * 24, "/");
if ($dopost == 'time') {
?>
<form name="form1" action="catalog_edit.php" method="post" onSubmit="return checkSubmit();">
<input type="hidden" name="dopost" value="savetime" />
<input type="hidden" name="id" value="<?php
echo $id;
?>
" />
<input type="hidden" name="topid" value="<?php
echo $myrow['topid'];
?>
" />
<input type="hidden" name="moresite" value="<?php
echo $myrow['moresite'];
?>
示例4: PutLoginInfo
function PutLoginInfo($uid){
$this->M_ID = $uid;
$this->M_LoginTime = time();
PutCookie("DedeUserID",$uid,$this->M_KeepTime);
PutCookie("DedeLoginTime",$this->M_LoginTime,$this->M_KeepTime);
}
示例5: PutLoginInfo
/**
* 保存用户cookie
*
* @access public
* @param string $uid 用户ID
* @param string $logintime 登录限制时间
* @return void
*/
function PutLoginInfo($uid, $logintime = 0)
{
global $cfg_login_adds, $dsql;
//登录增加积分(上一次登录时间必须大于两小时)
if (time() - $logintime > 7200 && $cfg_login_adds > 0) {
$dsql->ExecuteNoneQuery("Update `#@__member` set `scores`=`scores`+{$cfg_login_adds} where mid='{$uid}' ");
}
$this->M_ID = $uid;
$this->M_LoginTime = time();
$loginip = GetIP();
$inquery = "UPDATE `#@__member` SET loginip='{$loginip}',logintime='" . $this->M_LoginTime . "' WHERE mid='" . $uid . "'";
$dsql->ExecuteNoneQuery($inquery);
if ($this->M_KeepTime > 0) {
PutCookie('DedeUserID', $uid, $this->M_KeepTime);
PutCookie('DedeLoginTime', $this->M_LoginTime, $this->M_KeepTime);
} else {
PutCookie('DedeUserID', $uid);
PutCookie('DedeLoginTime', $this->M_LoginTime);
}
}
示例6: foreach
$last_vid = $uid;
foreach ($last_vids as $lsid) {
if ($i > 10) {
break;
} else {
if ($lsid != $uid) {
$i++;
$last_vid .= ',' . $last_vid;
}
}
}
} else {
$last_vid = $uid;
}
PutCookie('last_vtime', $vtime, 3600 * 24, '/');
PutCookie('last_vid', $last_vid, 3600 * 24, '/');
if ($cfg_ml->IsLogin() && $cfg_ml->M_LoginID != $uid) {
$vip = GetIP();
$arr = $dsql->GetOne("SELECT * FROM `#@__member_vhistory` WHERE mid='{$_vars['mid']}' AND vid='{$cfg_ml->M_ID}' ");
if (is_array($arr)) {
$dsql->ExecuteNoneQuery("UPDATE `#@__member_vhistory` SET vip='{$vip}',vtime='{$vtime}',count=count+1 WHERE mid='{$_vars['mid']}' AND vid='{$cfg_ml->M_ID}' ");
} else {
$query = "INSERT INTO `#@__member_vhistory`(mid,loginid,vid,vloginid,count,vip,vtime)\r\n VALUES('{$_vars['mid']}','{$_vars['userid']}','{$cfg_ml->M_ID}','{$cfg_ml->M_LoginID}','1','{$vip}','{$vtime}'); ";
$dsql->ExecuteNoneQuery($query);
}
}
$dsql->ExecuteNoneQuery("UPDATE `#@__member_tj` SET homecount=homecount+1 WHERE mid='{$_vars['mid']}' ");
}
$dpl->LoadTemplate($tplfile);
$dpl->display();
exit;
示例7: values
$zuozheurl = $typedir . ".html";
$keyword_in_query = "insert into `#@__keywords` (`keyword`, `rank`, `sta`, `rpurl`) values('{$typename}','30','1','{$zuozheurl}')";
$dsql->ExecuteNoneQuery($keyword_in_query);
}
}
//将小说插入文档关键词中
if ($reid != '45' && ($co_autokeytype == 2 || ($co_autokeytype = 3))) {
$row = $dsql->GetOne("SELECT `keyword` FROM `#@__keywords` WHERE `keyword`='{$typename}'");
if (!$row && strlen($typename) > 2) {
$typeurl = $typedir . "/";
$dsql->ExecuteNoneQuery("insert into `#@__keywords` (`keyword`, `rank`, `sta`, `rpurl`) values('{$typename}','30','1','{$typeurl}')");
}
}
UpDateCatCache();
if ($reid > 0) {
PutCookie('lastCid', GetTopid($reid), 3600 * 24, '/');
}
ShowMsg("成功创建一个分类!", "catalog_main.php");
exit;
}
}
}
//End dopost==save
//获取从父目录继承的默认参数
if ($dopost == '') {
$channelid = 1;
$issend = 1;
$corank = 0;
$reid = 0;
$topid = 0;
$typedir = '';
示例8: keepUser
/**
* 保持用户的会话状态
*
* @access public
* @return int 成功返回 1 ,失败返回 -1
*/
function keepUser()
{
if ($this->userID != '' && $this->userType != '') {
global $admincachefile, $adminstyle;
if (empty($adminstyle)) {
$adminstyle = 'dedecms';
}
@session_register($this->keepUserIDTag);
$_SESSION[$this->keepUserIDTag] = $this->userID;
@session_register($this->keepUserTypeTag);
$_SESSION[$this->keepUserTypeTag] = $this->userType;
@session_register($this->keepUserChannelTag);
$_SESSION[$this->keepUserChannelTag] = $this->userChannel;
@session_register($this->keepUserNameTag);
$_SESSION[$this->keepUserNameTag] = $this->userName;
@session_register($this->keepUserPurviewTag);
$_SESSION[$this->keepUserPurviewTag] = $this->userPurview;
@session_register($this->keepAdminStyleTag);
$_SESSION[$this->keepAdminStyleTag] = $adminstyle;
PutCookie('DedeUserID', $this->userID, 3600 * 24, '/');
PutCookie('DedeLoginTime', time(), 3600 * 24, '/');
$this->ReWriteAdminChannel();
return 1;
} else {
return -1;
}
}
示例9: synlogin
function synlogin($get, $post)
{
/* print_r($get);
$file = SLINEDATA.'/logintext.txt';
$fp=fopen($file,'wb');
fwrite($fp,"uid:".$get['uid']."</br>");
fwrite($fp,"username:".$get['username']."</br>");
fclose($fp);*/
if (!API_SYNLOGIN) {
return API_RETURN_FORBIDDEN;
}
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
$uid = $get['uid'];
$mobile = $get['username'];
$sql = "SELECT mid,pwd FROM `#@__member` WHERE `mobile` = '{$mobile}'";
$result = $this->db->GetOne($sql);
if (is_array($result)) {
PutCookie('UserId', $result['mid'], 3600);
}
PutCookie('UserName', $mobile, 3600);
}
示例10: while
if(!ereg("[0-9]",$k)) $myrow[$k] = $v;
}
}
//读取频道模型信息
$channelid = $myrow['channeltype'];
$row = $dsql->GetOne("select * from #@__channeltype where ID='$channelid'");
$nid = $row['nid'];
//读取所有模型资料
$dsql->SetQuery("select * from #@__channeltype where ID<>-1 And isshow=1 order by ID");
$dsql->Execute();
while($row=$dsql->GetObject())
{
$channelArray[$row->ID]['typename'] = $row->typename;
$channelArray[$row->ID]['nid'] = $row->nid;
}
//父栏目是否为二级站点
if(!empty($myrow['moresite'])){
$moresite = $myrow['moresite'];
}else{
$moresite = 0;
}
if($myrow['topID']==0){
PutCookie('lastCid',$ID,3600*24,"/");
}
require_once(dirname(__FILE__)."/templets/catalog_edit.htm");
ClearAllLink();
?>
示例11: array
// 若没有载入配置,则初始化一个默认小助手配置
if (!isset($cfg_helper_autoload)) {
$cfg_helper_autoload = array('util', 'charset', 'string', 'time', 'cookie');
}
// 初始化小助手
helper($cfg_helper_autoload);
}
//会员信息
require_once SLINEINC . '/member.class.php';
$keeptime = isset($keeptime) && is_numeric($keeptime) ? $keeptime : -1;
$User = new Member($keeptime);
//手机跳转
//判断是否是手机浏览
if ($cfg_mobile_open == '1') {
if (!empty($computerversion)) {
PutCookie('computer', 1, 3600);
$cookie = 1;
} else {
$cookie = GetCookie('computer');
$cookie = $cookie ? $cookie : 0;
if ($cookie == 0) {
DropCookie('computer');
}
}
if (Helper_Archive::isMobile() && $cookie == 0) {
//兼容性修复
$uri = $_SERVER["HTTP_X_REWRITE_URL"];
if ($uri == null) {
$uri = $_SERVER["REQUEST_URI"];
}
$currentUrl = 'http://' . $_SERVER['HTTP_HOST'] . $uri;
示例12: putLoginInfo
function putLoginInfo($uid, $logintime = 0)
{
global $dsql, $cfg_login_jifen;
//登录增加积分(上一次登录时间必须大于两小时)
$lastlogintime = $this->getLastLoginTime($uid);
if (time() - intval($lastlogintime) > 7200) {
$login_jifen = $cfg_login_jifen ? $cfg_login_jifen : 0;
$flag = $dsql->ExecuteNoneQuery("Update `#@__member` set `jifen`=`jifen`+{$login_jifen} where mid='{$uid}' ");
if ($flag && !empty($login_jifen)) {
Helper_Archive::addJifenLog($uid, "登陆赠送积分{$login_jifen}分", $login_jifen, 2);
}
}
$this->uid = $uid;
$this->logintime = time();
$loginip = GetIP();
$inquery = "UPDATE `#@__member` SET loginip='{$loginip}',logintime='" . $this->logintime . "' WHERE mid='" . $uid . "'";
$this->db->ExecuteNoneQuery($inquery);
if ($this->keeptime > 0) {
PutCookie('UserName', $this->username, $this->keeptime);
PutCookie('UserId', $uid, $this->keeptime);
PutCookie('LoginTime', $this->logintime, $this->keeptime);
} else {
PutCookie('UserId', $uid);
PutCookie('UserName', $this->username);
PutCookie('LoginTime', $this->logintime);
}
}