Click here to get back home

php include pages as a menu?

 HomeNewsGroups | Search | About
 alt.www.webmaster    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
php include pages as a menu? petesouthwest 10-24-2005
Get Chitika Premium
Posted by petesouthwest on October 24, 2005, 2:42 am
Please log in for more thread options


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


Similar ThreadsPosted
Which Web 2.0 bling to include on pages? July 10, 2007, 5:37 am
Is there any way to include a .com domain hosted in usa in (pages from UK) search results August 30, 2006, 4:14 am
CSS - Suckerfish menu - DHTML menu - help January 16, 2006, 6:43 pm
top menu leading to a sub menu on the sidebar March 24, 2007, 5:16 am
Re: SSI and HTML or PHP and include? January 25, 2006, 4:16 pm
Include file mystery March 8, 2006, 11:17 am
best way to include xml into html page??? October 26, 2006, 3:11 pm
Server side or PHP include? March 15, 2007, 6:04 pm
PHP include suddenly not working? October 1, 2007, 1:42 am
Loading a different include file every 5 seconds February 8, 2007, 7:25 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap