title: PHP - How to change the class of a link
body: <p>I am trying to learn PHP for a website that I am building.  In CSS, I have a class, <code>nav a.thispage</code>, setup to make a 'button' on the navigation be the same color as the highlight.  It works beautifully.  But, as I added pages, I find that I needed to constantly update all of the HTML files of the site, over, and over again.  I found out that PHP could help me to automate this.  I use the following PHP, in my HTML to do this:</p>
  
  <pre><code> &lt;?php include 'content/header.php';?&gt;
  </code></pre>
  
  <p>The header.php file has the following content:</p>
  
  <pre><code>&lt;header&gt;
    &lt;h1&gt;&lt;img id="headerimage" src="Images/GrandLodge.png"/&gt;Lodge&lt;/h1&gt;
    &lt;nav&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href="index.php"&gt;Home&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="events.php"&gt;Events&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="social.php"&gt;Social&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="about.php"&gt;About&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="contact.php"&gt;Contact&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="gamestores.php"&gt;Area Game Stores&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://someaddress" target="_blank"&gt;PFS&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/nav&gt;
  &lt;/header&gt;
  </code></pre>
  
  <p>Now, because I am using this method, I can't just set the <code>class="thispage"</code> on the a tag.  Is there a way to set the class, dynamically, with PHP?  If so, how to I tell if the page loading the html is actually the page that needs it?  Is using PHP even the correct way to handle this, or should I be using JavaScript?</p>
  
  <p>I know this is a lot, and I didn't really provide a lot of what I have done, but I can't actually seem to see what I need to do for this.  All I really need is a point in the right direction, rather than a full code sample.  </p>
  
  <p>Thank you for any help you can provide.</p>