title: PHP variable scope between various template files
body: <p>This is a newbie question, and I know it.</p>
  
  <p>Template structure is your usual index.php, with a few require_once()'s for the header/footer etc.</p>
  
  <p>I define a var at the top of index.php before any of the require_once()'s for the base url, such as $url = 'http://url'; </p>
  
  <p>I then want to echo this out into all template files, header/index/footer etc, it works inside index.php as expected, but fails with a undefined var in all template files that are included in.</p>
  
  <p>I know it's a var scope issue, but I'm totally perplexed how to fix it. </p>
  
  <p>I'm aware that the manual says vars are available to included files, however they aren't. Could it be a issue with my local PHP install?</p>
  
  <p>edit : Created a couple of test files, and a var is defined between 2 files, so why are they not working on my main site files?</p>
  
  <p>Any helps gracefully recieved.</p>
  
  <p>Many Thanks</p>