title: Using cookies to display number of times user has visited website in PHP
body: <p>So I'm fairly new to PHP and I've written up my first code to basically create two cookies to track the time the user last opened the website and a counter.</p>
  
  <p>I want my website to display the time the person last opened up the website, with a counter saying "it's the $cookieValue you've visited us!".</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;?php
      $cookieValue = 1;
  
      setcookie("time", $cookieValue, time()+(86400*365));
  
      $cookieLastVisit = null;
  
      setcookie("lastVisit", $cookieLastVisit, time()+(86400*365));
      ?&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Question 2&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;?php
      if (!isset($_COOKIE["time"])){
          echo ("Welcome to my webpage! It is the first time that you are here.");
  
          $visit = date(DATE_RFC1036);
          setcookie("lastVisit", $visit);
      }
      else {
          $cookieValue = ++$_COOKIE["time"];
  
          echo("Hello, this is the " . $cookieValue . " time that you are visiting my webpage. Last time you visited my webpage on: " . $cookieLastVisit);
  
          $visit = date(DATE_RFC1036);
          setcookie("lastVisit", $visit);
      }
      ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I've finished my code but can't grasp why when I open my website, absolutely nothing happens. </p>