title: Nested include with PHP
body: <p>I'm having trouble with nested includes. While I have seen there are a number if similar issues, they don't seem to help.</p>
  
  <p>Generally I don't have problems with includes, but recently I have been trying something new and I cannot get the nested includes to work.</p>
  
  <p>One solution: <a href="https://stackoverflow.com/questions/2860143/php-nested-include-behavior">php nested include behavior</a></p>
  
  <p>Basic setup:</p>
  
  <ul>
  <li>index.php includes '/include/header.php'</li>
  <li>header.php includes '/resources/login/index_alt.php'</li>
  <li>index_alt.php includes '/resources/login/index_auth.php'</li>
  <li>index_auth.php include '/class/Login.class.php' and
  '/class/Connection.class/php'</li>
  </ul>
  
  <p>I do not actually write the paths like this (its to understand the depth).
  This is how it will look on the pages.</p>
  
  <p><strong>index.php</strong>:</p>
  
  <ul>
  <li>include('include/header.php');</li>
  </ul>
  
  <p><strong>header.php</strong>: (header is included at every depth level except for /resources/...)</p>
  
  <ul>
  <li>include('../resources/login/index_alt.php');</li>
  </ul>
  
  <p><strong>index_alt.php</strong>:</p>
  
  <ul>
  <li>include('index_auth.php');</li>
  </ul>
  
  <p><strong>index_auth.php</strong>:</p>
  
  <ul>
  <li>include('../../class/Login.class.php');</li>
  <li>include('../../class/Connection.class.php');</li>
  </ul>
  
  <p>At some depth levels the header file is accepted, but includes nested in will not...</p>