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 ...
linking pages
Moderator: General Moderators
- DigitalMind
- Forum Contributor
- Posts: 152
- Joined: Mon Sep 27, 2010 2:27 am
- Location: Ukraine, Kharkov
Re: linking pages
Code: Select all
<a href="/index.php">home</a>
<a href="/about.php">about</a>Re: linking pages
noo i want them to be in the admin directory index page <a href="../index.php">home</a>
and in the homepage (public_html/index.php) <a href="index.php">home</a>
but i want to require the same page each time ...
and in the homepage (public_html/index.php) <a href="index.php">home</a>
but i want to require the same page each time ...
- DigitalMind
- Forum Contributor
- Posts: 152
- Joined: Mon Sep 27, 2010 2:27 am
- Location: Ukraine, Kharkov
Re: linking pages
I thought my code solves the issue. Did you try it?
Re: linking pages
yeah yeah sory i didn't pay attention to the " / " .. thanks for ur helppppp ... ^^