title: PHP Include links
body: <p>Hello I'm having my first serious go with PHP to create a sample script for my self. It has a basic structure, in my root folder I have:</p>
  
  <ul>
  <li>index.php</li>
  <li>core folder (holds most of my php function files)</li>
  <li>includes (holders my header.php and footer.php)</li>
  <li>sites - (sites has 3 further folders site A, B, C)</li>
  <li>CSS</li>
  <li>js</li>
  </ul>
  
  <p>All pages are made up by taking a header.php and footer.php from the includes folder and then each page has its own content in the middle. The header.php contains (as well as basic html and links to javascripts stylesheets ect) includes from core folder like so:</p>
  
  <ul>
  <li>include_once '/core/connect.php';</li>
  </ul>
  
  <p>Now these all work great using the index.php which provides links to the 3 different sections of the site, sitea, siteb and sitec.</p>
  
  <p>But when you navigate out of the document root to say /sites/sitea/index.php all those links are now broken.</p>
  
  <p>What is the best way to go about building the links in the header.php section so they are relative site wide no matter which folder you are in?</p>