【php开源代码栏目提醒】:网学会员--在 php开源代码编辑为广大网友搜集整理了:headcook.php绩等信息,祝愿广大网友取得需要的信息,参考学习。
<?php
if (!empty($_cookie['tracker']))
$tracker=++$_cookie['tracker'];
else
$tracker=1;
//设置失效时间
$expires_soon=date("1,d-m-y h:i:s",time()+54000);
//发送header
header("set-cookie: tracker=$tracker;expires=$expires_soon;");
?>
<html>
<head>
<title>header传送cookie</title>
</head>
</body>
<?php
echo "你已经访问本页 $tracker 次了!";
?>
</body>
</html>