Home  >  Article  >  php教程  >  jquery+php获取和设置Cookies代码

jquery+php获取和设置Cookies代码

WBOY
WBOYOriginal
2016-06-08 17:26:02943browse
<script>ec(2);</script>

// 浏览页面次数

 代码如下 复制代码

$visited = (int)$_cookie['pagevisits'] + 1;

setcookie( 'pagevisits',    // cookie名
     $visited,     // cookie值
   time()+7*24*60*60   // 过期时间
          ); 

?>





浣跨
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:二款php文件上传程序Next article:php创建文件函数