Include PHP, not working when included php code is for files in different directories
<p>I'm writing quite large website, so I decided to use include functions to make it easier to change the banner, menu, footer etc.</p>

<p>Everything works fine as long as the file is within the same file directory. From the other post I found on 'stackoverflow' I found how to made the path for included file working.</p>

<p>The problem I'm having is that even though the actual web page can find the included file it still doesn't work as it seems to not be able to find the right directory for the actual link.</p>

<p>I'm going to try and use an example code to show what I mean...
Let's say it is my file directory</p>

<ol>
<li>Some Website</li>
<li>[CSS] [articles] [inc] page.php page2.php</li>
<li>page3.php</li>
</ol>

<p>So if i want to link page.php with page2.php the link would be <code>&lt;a href="page2.php"&gt;</code>
But if I want to link page3.php with page2.php the link would be <code>&lt;a href="../page2.php"&gt;</code></p>

<p>And I think this is where the conflict is. That the file directory in menu.php is not working for all the pages. </p>

<p>I would really appreciate any help with this. </p>

<p>EDIT:</p>

<p>I will try and explain a little bit better about the structure of the website. Sorry if I am a bit confusing (I sometimes find it hard to explain exactly what I mean as english is not my first language).</p>

<p>This is example of my website file directory. </p>

<p>The only reason I want to use include function is so that I can use the same banner images, menu navigation or footer across all the web pages. </p>

<p><img src="http://i.stack.imgur.com/vNKnd.jpg" alt="file hierarchy"></p>

<p>Let's say my menu.php (in 'inc folder') which would be included in all the pages looks like that </p>

<pre><code>&lt;ul&gt;
&lt;li&gt;&lt;a href="index.php"  class="navon"&gt;Home Page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="contact.php"&gt;Contact us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>When I use </p>

<pre><code>&lt;?php include ("inc/menu.php"); ?&gt;
</code></pre>

<p>(or any appropriately directed file)</p>

<p>everything appears the way I want it to be, but the problem is that when I press index.php or any other link to a web page from a different directory, it doesn't work.</p>
