title: display hyperlink in php
body: <p>I am new to php. Here is a code to check if the user is logged in using session and then allowing the user. </p>
  
  <h1>VALIDATION</h1>
  
  <pre><code>&lt;?php
  
  session_start();
  
  $uname = $_POST['uname'];
  $pass = $_POST['pass'];
  
  if($uname  == "admin"  &amp;&amp;  $pass == "admin")
  {
      $_SESSION['uname'] = $uname;
      $_SESSION['auth'] = 1;
      echo "Welcome Mr ".$uname.". You are now logged in ";
      echo "&lt;br&gt;";
      echo "&lt;a href='TakeMeHome.html'&gt;Click here to access the application &lt;/a&gt;";
  }
  else
  {
      echo "Invalid username or password";
  }
  
  ?&gt;
  </code></pre>
  
  <h1>Page</h1>
  
  <pre><code>&lt;?php
  
  session_start();
  
  
  if($_SESSION['auth'] != 1)
  {
      echo "You are not logged in! ";
      echo "&lt;a href = \"TakeMeHome.html\"&gt;";
      echo "Access Application";
      echo  "&lt;/a&gt;";
      exit();
  }
  
  ?&gt;
  
  &lt;html&gt;
  You are now logged in
  &lt;/html&gt;
  </code></pre>
  
  <p>But the link tag  is displaying </p>
  
  <pre><code>"; echo "Access Application"; echo ""; exit(); } ?&gt; 
  </code></pre>
  
  <p>along with the html data. No verification is done. I know there are many better ways to validate user is logged in or not. But i am learning sessions and hence i am using sessions.
  Can you please tell me where i am going wrong?<br>
  regards.</p>