<?php

$first_name = "";

if (isset($_COOKIE['fname'])) {
    $first_name = $_COOKIE['fName'];
}

echo("<h3>Hello $first_name</h3>");

$visits = 1;

if(isset($_COOKIE['page-counter'])){
    $visits += 1;
}

setcookie("page-counter", $visits, time() + (60*60*24*365));
echo($visits);
?>