cookie计数器 简单的cookie计数器实现源码

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

cookie计数器 简单的cookie计数器实现源码

  2021-03-18 我要评论
想了解简单的cookie计数器实现源码的相关内容吗,在本文为您仔细讲解cookie计数器的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:cookie计数器,下面大家一起来学习吧。

复制代码 代码如下:

<?php  if (!empty ($_COOKIE['example'] ))
             $example = ++$_COOKIE['example'] ;
        else $example = 1 ; 
            setcookie("example",$example,time()+54000);
?>

复制代码 代码如下:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>简单的COOKIE计数器</title>
<style type="text/css">
<!--
.style1 {
    font-size: 14px;
    font-family: "华文琥珀";
}
.style2 {
    font-size: 25px;
    font-family: "华文行楷";
}
.style3 {
    font-size: 13px;
    font-family: "华文琥珀";
}
-->
</style>
</head>
<body>
<table width="350" height="208" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td background="images/136.JPG">
      <table width="240" height="208" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="30" align="center" class="style2"> </td>
      </tr>
      <tr>
        <td height="25" align="center" class="style2">欢迎光临</td>
      </tr>
      <tr>
        <td height="30" align="center" valign="top">
          <span class="style1">本页已经被访问:</span>
          <span class="style2"> <?php echo "$example";?>次</span>
        </td>
      </tr>
      <tr>
        <td height="18" align="center" valign="top">
          <span class="style3">简单的COOKIE计数器</span>
        </td>
      </tr>
      <tr>
        <td height="30" align="center"> </td>
      </tr>
    </table> </td>
  </tr>
</table>
</body>
</html>


 

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们