You are here: Re: relative links in included pages? « All PHP « IT news, forums, messages
Re: relative links in included pages?

Posted by Tobierre on 10/25/05 02:47

Hi,

You don't have to use absolute links just use links that are relative to
your site route
e.g /directoryname/page.php

No need for ../../ etc and no problem to remember!

Tobierre


"Pete" <petesouthwest@hotmail.com> wrote in message
news:1130146841.908425.172770@g49g2000cwa.googlegroups.com...
> Hi
>
> i have a page hmenu.htm that acts like a menu bar; containing links to
> other pages on my site ie:
> <a href="../CMS/sysReq.htm">
> <a href="../index.php"> etc
>
> I am includeing this in all of the pages on my site using:
> <?php include("includepages/hmenu.htm"); ?>
>
> The pages that use the include are in various levels up to about 4
> subdirectories deep.
>
> However, my problem is that as the links are relative, on many of the
> pages showing the included file, the links dont work as I am not going
> far enough back up the path structure. ie ../index.php on some pages
> needs to be ../../index.php etc.
>
> Looking on the net I found suggestions that I might have a hmenu.htm
> for each folder level, but that seems to negate the advantage of using
> include!
>
> I ahve also found suggestions that I need to put absolute links in ie
> www.mydomain.com/index.php. Is that the only way?
>
> Any help appreciated.
> Thanks
> Pete
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация