PHP Session et Cookies: Compter le nombre de visiteur à l’aide des cookies

Author:
 
<?php
     session_start();  #start a session

    if ( !isset( $_SESSION['count'] ) ) 
     $_SESSION['count'] = 1; else $_SESSION['count']++;
?>
 
 
<html>
<head>
<title>Count Visits</title>
</head>
 
<body>
<h2>You have visited this page <?php echo( $_SESSION['count'] ); ?> times in this session</h2>
 
</body>
</html>
  
  

Leave a Reply

Your email address will not be published. Required fields are marked *


+ eight = 17