[/code]
<?php
global $count;
$count=1;
if(!isset($_COOKIE["visittime"])){ setcookie("visittime",date("y-m-d H:i:s"));
setcookie("visitcount",1); echo "歡迎你第一次訪問網站!";
}
else{
setcookie("visittime",date("y-m-d,H:i:s"),time()+60); $count=$_COOKIE['visitcount']+1;
setcookie("visitcount",$count); echo "你上次訪問網站的時間為:".$_COOKIE['visittime'];
echo "<br>";
}
echo "你第".$_COOKIE['visitcount']."訪問網站的時間為:".date("y-m-d H:i:s");
?>
[/code]