php USES cookie to implement access statistics code

  • 2020-05-07 19:17:46
  • OfStack

[/code]
< ?php
global $count;
$count=1;
if(!isset($_COOKIE["visittime"])){ setcookie("visittime",date("y-m-d H:i:s"));
setcookie (" visitcount ", 1); echo "welcome to visit the website for the first time!" ;
}
else{
setcookie("visittime",date("y-m-d,H:i:s"),time()+60); $count=$_COOKIE['visitcount']+1;
setcookie (" visitcount ", $count); "The last time you visited the website was :".$_COOKIE['visittime'];
echo " < br > ";
}
$_COOKIE['visitcount']." time of visit :".date(" y-m-d H:i:s");
? >
[/code]

Related articles: