PHP新手,不怎么懂cookie,求大神帮忙,怎么使用cookie设置浏览记录,目前在做第一个项目,卡在这了,求大神帮忙啊

解决方案 »

  1.   

    http://www.cnblogs.com/qinying/archive/2010/09/15/1826846.html
      

  2.   

    在cookie里面增加一个字段history类型是数组
    比如是商城中
    用户每请求一个goods_id=xxx的页面时,记录该ID
    然后array_unique清除history里面的重复项
    最后在指定历史显示页面中读取这个字段的数据来显示浏览历史记录
      

  3.   

    使用Cookie技术计算网站的月访问量
    //应用COOKIE技术计算网站的月访问量
    <?php
     if (!empty ($_COOKIE['counter'] )){
             $counter = $_COOKIE['counter']+1 ;
     }
     else{
     $counter = 1 ;  
     }
     setcookie("counter",$counter,time()+2678400);
    ?>
    您是第</span><span class="style2">&nbsp;<?php echo "$counter";?>&nbsp;</span><span class="style1">位访客</span>