title: How can I make all paths relative to document root?
body: <p>My project dir structure is</p>
  
  <pre><code>/admin
      L index.php
  /includes
      L scripts.php
      L common.php
  /css
  /js
  index.php
  header.php
  footer.php
  ...
  </code></pre>
  
  <p>In index.php I include /includes/scripts.php which contains references to various css files in /css dir like such:</p>
  
  <pre><code>&lt;link rel="stylesheet" type="text/css" href="css/jquery.alerts.css" /&gt;
  &lt;link rel="stylesheet" type="text/css" href="css/style.css" /&gt;
  </code></pre>
  
  <p>etc...</p>
  
  <p>Everything works fine when including /includes/scripts.php from the document root but if I include scripts.php from inside a different dir, ie /admin, then the paths are no longer valid and the inclusion of all files referenced fails. How can I make all paths relative to document root no matter where I call them from within my project?</p>