How to use a root path with require?
<p>I have a private section within a site with a folder structure like so</p>

<pre><code>www.site.com/privatePath/secretFolder/login.php
</code></pre>

<p>Then some subfolders eg</p>

<pre><code>www.site.com/privatePath/secretFolder/grandmasRecipes/applePie.php
</code></pre>

<p>There is a shared functions.php alongside the login.php</p>

<p><code>www.site.com/privatePath/secretFolder/functions.php</code> (creates $connection, mysql blah blah)</p>

<p>I have various subfolders and files i wish to connect to functions.php, some created dynamically so the solution should work from any file/folder position whatsoever. </p>

<p>Just to clarify:</p>

<p>Because the same file could be called within different folders I would like it to call the functions.php file not from where the file is but in relation to the root folder. So without relative ../ etc references</p>

<p>my question:
How can i access a required php file from any file within my website?</p>