title: PHP if/then to display link
body: <p>I'm trying to display a "log in" / "log out" link. I want to display the log in link if they are not logged in, etc.  I'm having trouble getting this to work.  Heres what I've been trying:</p>
  
  <pre><code>&lt;?php if (isset($_SESSION['access_token'])) 
   { ?&gt; &lt;a href="logout.php"&gt;Log out&lt;/a&gt;&lt;?php } ?&gt;
  &lt;?php
  else 
  { ?&gt; &lt;a href="login.php"&gt;Log In&lt;/a&gt;  &lt;?php } ?&gt;
  </code></pre>
  
  <p>Basically, if the assess_token is set, it will show a link to log out.  And if not, a log in link.  I keep getting this as an error: </p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected T_ELSE</p>
  </blockquote>
  
  <p>And i've tried this variation:</p>
  
  <pre><code>&lt;?php if (isset($_SESSION['access_token'])) 
  { echo "&lt;a href="logout.php"&gt;Log out&lt;/a&gt;" }
  else 
  { echo "&lt;a href="login.p"&gt;Log In&lt;/a&gt;" } ?&gt;
  </code></pre>
  
  <p>which get me: </p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' </p>
  </blockquote>
  
  <p>what am i missing here?</p>