linking pages
Posted: Sat Feb 26, 2011 9:43 am
hello .. i'm creating a website but i faced a problem in the page structure ...
i want in the bottom to each page to have a small bar like the menu bar example http://www.psd2html.com/
so i created a page call nav.php in a directory named "inc".
let's say that nav.php contain this code:
[text]<div>
<ul>
<li><a href="index.php">home</a></li>
<li><a href="about.php">about</a></li>
<ul>
</div>[/text]
in the public_html/index.php when i use
require('inc/nav.php');
every thing work fine but when i enter to a directory lets say public_html/admin/index.php
and i use require('../inc/nav.php');
the text appears but the link are not correct for the <li>about<li> it will post public_html/admin/about.php
i wanted to be updated automaticaly in each page like this public_html/about.php
In fact i am using this method to not repeat the same code in each page and if i want to update it i will update it one time only ...
thanks for help hope u understand what i want ...
i want in the bottom to each page to have a small bar like the menu bar example http://www.psd2html.com/
so i created a page call nav.php in a directory named "inc".
let's say that nav.php contain this code:
[text]<div>
<ul>
<li><a href="index.php">home</a></li>
<li><a href="about.php">about</a></li>
<ul>
</div>[/text]
in the public_html/index.php when i use
require('inc/nav.php');
every thing work fine but when i enter to a directory lets say public_html/admin/index.php
and i use require('../inc/nav.php');
the text appears but the link are not correct for the <li>about<li> it will post public_html/admin/about.php
i wanted to be updated automaticaly in each page like this public_html/about.php
In fact i am using this method to not repeat the same code in each page and if i want to update it i will update it one time only ...
thanks for help hope u understand what i want ...