title: Conditional Statements in PHP code Between HTML Code
body: <p>I'm having a bit of an issue by using Conditional Statements in PHP separated by HTML code. This is the type of code I'm trying to write. This is a profile page and it should only be seen by the user whose profile it is (i'm using session variables for checking that) : </p>
  
  <pre><code>&lt;?php if(check if user is logged in) ?&gt;
  &lt;display users profile in html&gt;
  &lt;?php else ?&gt;
  &lt;display an error&gt;
  </code></pre>
  
  <p>But this doesn't work. I also tried using the shorthand notation by putting a <code>:</code> at the end of the <code>if</code> and using the <code>endif</code> statement, but it didn't work. ( On an earlier project , the <code>:</code> method worked for <code>foreach</code> and <code>endforeach</code> so I thought I would try it out )</p>
  
  <p>Any Ideas ? </p>