homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Is this how I do it?

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


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)


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)

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)

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)


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 :)

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved