PHP Examples - Cookie - Time of Last Visit


PHP Examples - Cookie - Time of Last Visit


Program:
<html >
<head>

<title>PHP Example 8 : COOKIE</title>
</head>

<body>
<?php
 
 echo "<br/>PHP Example 8";
 echo"<br/>"; // line break
 echo"<h1>";
 echo"COOKIE";
 echo"</h1>";
 echo"<br/>";
 echo "Server Time:\t".date("D,d M Y , g:i:s A")."<br/>";
 // echo "Cookie created...";

 if(isset($_COOKIE['time_of_visit']))
 {
  $y=$_COOKIE['time_of_visit'];
  echo "<br/>You visited here : $y";
 }
 $x=60*60*24*60+time();
 setcookie('time_of_visit',date("D,d M Y , g:i:s A"), $x);

 echo "<br/><br/><br/><br/><b>";
 echo"WWW.2K8618.BLOGSPOT.COM";
 echo"</b>";

?>

</body>
</html>



Output:

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...