absolute/relative paths for php includes
<p>I have a function(orders) with many php includes in a file called extract.php</p>

<p><a href="http://example.com/application/dir1/dir2/dir3/extract.php" rel="nofollow">http://example.com/application/dir1/dir2/dir3/extract.php</a></p>

<pre><code>function orders ($username)
{
 require ("functions.inc.php");
 define("DATAGRID_DIR", "./../datagrid/");
 define("PEAR_DIR", "./../datagrid/pear/");
 require_once (DATAGRID_DIR . 'datagrid.class.php');
 require_once (PEAR_DIR . 'PEAR.php');
 require_once (PEAR_DIR . 'DB.php');
 require_once ('./../datagrid/classes/database.class.php');

//function code here
}
</code></pre>

<p>I have another file(install.php) that calls this function inside the same directory and it works very well.</p>

<pre><code>&lt;?php
include ("extract.php");
orders ("643443876996");
?&gt;
</code></pre>

<p>However, when i include it in another function in this path 
<a href="http://example.com/orders/getorder.php" rel="nofollow">http://example.com/orders/getorder.php</a>, it gives me error that it cannot find my files 'datagrid.class.php';</p>

<pre><code>    &lt;?php
    include ("include('../application/dir1/dir2/dir3/extract.php');");
    orders ("643443876996");
    ?&gt;
</code></pre>

<p>How can I get the path referencing correct?</p>
