title: Not able to implement common header.php for my website
body: <p>I am trying a put a common header file across all my pages on the website. I am just doing it for one page currently. </p>
  
  <p>I am using a class "current" to mark a given page as the current page. I am not able to do this using the below html. The header shows 'class="current" href="contact.php" > Contact Us' instead of just "Contact Us". Running the code would give you a better idea.</p>
  
  <p>Seems to be a simple issue but somehow am not able to fix this. Kindly help.</p>
  
  <pre><code>&lt;?php               
  $pagename=strtolower(basename($_SERVER['REQUEST_URI']));
  ?&gt;    
      &lt;div id="header"&gt;
          &lt;div id="site_title"&gt;
  
          &lt;/div&gt;  &lt;!-- end of site_title --&gt;
      &lt;/div&gt;&lt;!-- end of header --&gt;
  
      &lt;div id="menu"&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;a href="index.php" class="current"&gt;Home&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="getstarted.php"&gt;Getting Started&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="account.php"&gt;My Account&lt;/a&gt;&lt;/li&gt;
              &lt;li class="current"&gt;&lt;a href="about.php"&gt;About Us&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a &lt;? if ($pagename=='contact.php') {?&gt; class="current" &lt;? } ?&gt; href="contact.php" &gt;Contact Us&lt;/a&gt;&lt;/li&gt;
  
  
          &lt;/ul&gt; 
      &lt;/div&gt; &lt;!-- end of menu --&gt;
  
      &lt;div id="middle"&gt;
          &lt;h1&gt;Welcome to my site&lt;/h1&gt;
          &lt;p&gt;&lt;/p&gt; 
      &lt;/div&gt; &lt;!-- end middle--&gt;
  </code></pre>
  
  <p>----------------updated---------------------------</p>
  
  <p>I am not sure what might be the reason for this.. The second line works for me and the first does not.. Would appreciate if anyone tells me why is this strange behaviour</p>
  
  <pre><code>&lt;li &lt;? if ($pagename=='about.php') {?&gt; class="current" &lt;? } ?&gt;&gt;&lt;a href="about.php"&gt;About Us&lt;/a&gt;&lt;/li&gt;
  &lt;li &lt;?php if ($pagename=='contact.php') {?&gt; class="current" &lt;?php } ?&gt;&gt;&lt;a href="contact.php" &gt;Contact Us&lt;/a&gt;&lt;/li&gt;
  </code></pre>