title: Using PHP variables for website navigation
body: <p>I've used this method on a few website builds with no obvious problems. But I'm wondering if it's an okay/proper way to utilize PHP variables as website navigation/page indicators so that site-wide changes can be easily managed in 1 file (upper.php)? Are there any drawbacks? Maybe too many requests to the server, load times, improper coding or negative S.E.O. ramifications?</p>
  
  <p>I've omitted surrounding code such as &lt; body >, etc. for simplicity and indicated where more code would be with "<strong>...</strong>"</p>
  
  <p><strong>index.php</strong></p>
  
  <pre><code>&lt;?php $urhere="home"; include ("upper.php"); ?&gt;
      &lt;div&gt;This is the Home page content&lt;/div&gt;   
  ... 
  </code></pre>
  
  <p><strong>about.php</strong></p>
  
  <pre><code>&lt;?php $urhere="about"; include ("upper.php"); ?&gt;
      &lt;div&gt;This is the About page content&lt;/div&gt;
  ...    
  </code></pre>
  
  <p><strong>contact.php</strong></p>
  
  <pre><code>&lt;?php $urhere="contact"; include ("upper.php"); ?&gt;
      &lt;div&gt;This is the Contact page content&lt;/div&gt; 
  ...
  </code></pre>
  
  <p><strong>upper.php</strong></p>
  
  <pre><code>...
  
  &lt;meta name="description" content="
      &lt;?php
          if ($urhere=="home") echo "Home page description";
          if ($urhere=="about") echo "About page description";
          if ($urhere=="contact") echo "Contact page description";
      ?&gt;
  
  ...
  
  &lt;title&gt;
      &lt;?php
          if ($urhere=="home") echo "Home page Title";
          if ($urhere=="about") echo "About page Title";
          if ($urhere=="contact") echo "Contact page Title"; 
      ?&gt;
  &lt;/title&gt;
  
  ...
  
  &lt;div id="nav"&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href="/home"&lt;?php if ($urhere=="home") echo " class=\"urhere\""; ?&gt;&gt;Home&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="/about"&lt;?php if ($urhere=="about") echo " class=\"urhere\""; ?&gt;&gt;About&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="/contact"&lt;?php if ($urhere=="contact") echo " class=\"urhere\""; ?&gt;&gt;Contact&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>