Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Is this how I do it?

11:04 am on Nov 20, 2005 (gmt 0)

5+ Year Member


To begin I am totally unconversant with anything but html and not so good at that.

I have a home page with headers and menu bar across the top, links menu down the left side forget the main body.

Down the left are my links around 12 of them written up as :

<ul><li class="heading"><a href="construction1.htm" ><u><font size="-1"><font color="#000000">Honed Limestone</font></font></u></a></li></ul>
<ul><li class="heading"><a href="construction1.htm" >Antique Limestone</a></li></ul>
<ul><li class="heading"><a href="construction1.htm" >Random Limestone</a></li></ul>

What I want to do is make this menu (or even the whole page structure) appear throughout the site as a constant.

Is it possible ( I have php enabled i think)

Please! Baby steps :)

Thank you


11:52 am on Nov 20, 2005 (gmt 0)

10+ Year Member


Yes, it is relatively easy using the php include or require function.
1. create text file containing the HTML for your menu, i.e. <ul><li><a etc.
2. Save this file as e.g. menu.html
3. In the pages that will use the menu use the following tag instead of the menu: <?php include ('menu.html');?>

require() and include() are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error, i.e. if your menu file is not found it won't load the whole page.

I hope this helps.

12:22 pm on Nov 20, 2005 (gmt 0)

5+ Year Member

You don't really need any PHP, use the html #include command. For example, save your left links code section as leftlinks.html, and use a command like <!--#include file="leftlinks.html" -->
at the point in the page where you want it to appear.
12:25 pm on Nov 20, 2005 (gmt 0)

5+ Year Member

Try mapostel's php version first to see if php is enabled on your server. Once you taste the power of php you won't turn back!
4:57 pm on Nov 20, 2005 (gmt 0)

5+ Year Member


You two guys - I have learned more from your 2 posts than I have learned all week because you took the time to explain the moves.

Thank you very much


Umm I wondering now if I can make it work :)