$id=$_GET['id'];
$cur_time=date(time());
if (!empty($_COOKIE['SHOP']['history']))
{
$history = explode(',', $_COOKIE['SHOP']['history']);
array_unshift($history, $id);
$history = array_unique($history);
while (count($history) > 3)
{
//将数组最后一个单元弹出,直到它的长度小于等于5为止
array_pop($history);
}
setcookie('SHOP[history]', implode(',', $history), $cur_time + 3600 * 24 * 30);
}else{
setcookie('SHOP[history]', $id, $cur_time + 3600 * 24 * 30);
}
$history =isset ($_COOKIE['SHOP']['history']) ? $_COOKIE['SHOP']['history'] : 0;
$his=explode(',',$history);
<?php
for($i=0;$i<sizeof($his);$i++){
$sql_co='select * from s_lea where id='.$his[$i];
$rs_co=mysql_query($sql_co);
$row_co=mysql_fetch_array($rs_co);
}
?>
没有合适的资源?快使用搜索试试~ 我知道了~
php利用session_start查看浏览记录
共1个文件
txt:1个
3星 · 超过75%的资源 需积分: 9 15 下载量 54 浏览量
2014-03-08
16:49:29
上传
评论 1
收藏 563B RAR 举报
温馨提示
php利用session_start()读取浏览记录,如有些网站上的产品也会有浏览记录,输出你最近浏览过的产品
资源推荐
资源详情
资源评论
收起资源包目录
php-session_start浏览记录.rar (1个子文件)
php-session_start浏览记录.txt 766B
共 1 条
- 1
资源评论
- donplin2014-11-10这个不是很好用。。。。不过还是谢谢!
斌starin
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功