php include menu
php include menu
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
- Karlis
- Site Admin
- Posts: 3605
- Joined: Mon Jul 15, 2002 5:24 pm
- Location: Riga, Latvia, Europe
- Contact:
Re: php include menu
You can select whether to use absolute or relative URLs when creating your menu code. I recommend absolute paths if you use php.
Re: php include menu
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
Re: php include menu
Hi Max,
I use php and I "include" the menu code (menu.htm in my case) on my pages by doing something like this:
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.
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>
"menu.htm" is the output generated by MenuMaker.
Of course, don't forget to use the PHP extension for your pages.