Having includes with variables in two places at once
<p>I have a small situaton here. I'm building a custom CMS for one of my websites.</p>

<p>Below is the code for the main index page:</p>

<pre><code>&lt;?php
require("includes/config.php");   
include("includes/header.php");  
 if(empty($_GET['page'])) {     
     include('pages/home.php'); 
  } else {
   if(!empty($_GET['page'])){ 
$app = mysqli_real_escape_string($db,$_GET['page']);
$content = mysqli_fetch_assoc(mysqli_query($db, "SELECT * FROM pages_content WHERE htmltitle = '$app'")) or die(mysqli_error($db));
$title = $content['title'];
$metakeywords = $content['htmlkeywords'];
$metadesc = $content['htmldesc'];
?&gt;
&lt;h1&gt;&lt;?php echo $content['title']; ?&gt;&lt;/h1&gt;&lt;hr /&gt;&lt;br /&gt;
&lt;div id="content"&gt;&lt;?php echo $content['content']; ?&gt;&lt;/div&gt;     
&lt;? } else { include('includes/error/404.php');} }
include('includes/footer.php'); ?&gt;
</code></pre>

<p>The file, includes/header.php contains code to echo variables, such as, page title and meta stuff.</p>

<p>The issue is that when the <code>include("includes/header.php");</code> is where it is, outside of the if conditions, it will not echo the varables, obviously, however, I can't put the include in the if condition otherwise, the home page, which does not require any url variables will show without these conditions.</p>

<p>What do I do?</p>
