// Checking if the visitor has a cookie in his brower, otherwise the script will set one. if (!isset($_COOKIE[countercookie])) { // Set the cookie for one year Setcookie("countercookie",1,time()+31536000); // Print a message echo "
"; } else { // Increase the cookie value by one Setcookie("countercookie",$_COOKIE[countercookie]+1,time()+31536000); // Print a message } ?>