php include menu

Post your questions and problem reports here.
Post Reply
User avatar
MaxD
Posts: 127
Joined: Mon Dec 18, 2006 10:05 pm
Location: UK
Contact:

php include menu

Post by MaxD »

I'm looking at Easy button & menu maker for a new site, and been looking into using more php to save time. Is using php includes a good way of adding this menu to my pages? Should the links to the files created be relative or absolute urls?
Amateur web design now dabbling with php and jquery
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Re: php include menu

Post by Karlis »

You can select whether to use absolute or relative URLs when creating your menu code. I recommend absolute paths if you use php.
Karlis Blumentals
Blumentals Software
www.blumentals.net
User avatar
MaxD
Posts: 127
Joined: Mon Dec 18, 2006 10:05 pm
Location: UK
Contact:

Re: php include menu

Post by MaxD »

Thanks for the info. Absolute urls seems easier, as folders get moved etc. Will try it out.
Amateur web design now dabbling with php and jquery
Mitch
Posts: 7
Joined: Fri Nov 20, 2009 12:13 am

Re: php include menu

Post by Mitch »

Hi Max,
I use php and I "include" the menu code (menu.htm in my case) on my pages by doing something like this:

Code: Select all

<div align="center"><?php include("menu.htm"); ?></div>
It is a great way to easily add your menu to every page.
"menu.htm" is the output generated by MenuMaker.
Of course, don't forget to use the PHP extension for your pages.
Post Reply