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?
I've omitted surrounding code such as < body >, etc. for simplicity and indicated where more code would be with "..."
index.php
<?php $urhere="home"; include ("upper.php"); ?>
<div>This is the Home page content</div>
...
about.php
<?php $urhere="about"; include ("upper.php"); ?>
<div>This is the About page content</div>
...
contact.php
<?php $urhere="contact"; include ("upper.php"); ?>
<div>This is the Contact page content</div>
...
upper.php
...
<meta name="description" content="
<?php
if ($urhere=="home") echo "Home page description";
if ($urhere=="about") echo "About page description";
if ($urhere=="contact") echo "Contact page description";
?>
...
<title>
<?php
if ($urhere=="home") echo "Home page Title";
if ($urhere=="about") echo "About page Title";
if ($urhere=="contact") echo "Contact page Title";
?>
</title>
...
<div id="nav">
<ul>
<li><a href="/home"<?php if ($urhere=="home") echo " class=\"urhere\""; ?>>Home</a></li>
<li><a href="/about"<?php if ($urhere=="about") echo " class=\"urhere\""; ?>>About</a></li>
<li><a href="/contact"<?php if ($urhere=="contact") echo " class=\"urhere\""; ?>>Contact</a></li>
</ul>
</div>