Change menu from HTML to PHP [Solved]
8 posts
• Page 1 of 1
Change menu from HTML to PHP [Solved]
OK below is the HTML from my church's front page with everything except the menu part cut out. How would you change at least the "TreeMenuNav" part to PHP so I don't have to update it the way it is now on 30+ pages? Thanks in advance.
- Code: Select all
<head>
<meta>
<title></title>
<script type="text/javascript" src="./js/menu.js"></script>
</head>
</html>
<body>
<div id="leftbar" class="lsidebar">
<div id="NavDiv">
<div id="TreeMenuCtrl">
<p><a href="#">Expand All</a> | <a href="#">Collapse All</a></p>
</div>
<div id="TreeMenuNav">
<div><a href="./index.html" target="_top" tabindex="1">Home</a></div>
<div><a href="#" tabindex="2">What's the Pointe?</a>
<div><a href="./about_us.html" tabindex="3">About Us</a></div>
<div><a href="./beliefs.html" tabindex="4">Our Core Beliefs</a></div>
<div><a href="./values.html" tabindex="5">Our Core Values</a></div>
<div><a href="#" tabindex="6">Our History</a>
<div><a href="./history.html" tabindex="7">History</a></div>
<div><a href="./former_pastors.html" tabindex="8">Former Pastors</a></div>
</div>
<div><a href="./mission.html" tabindex="9">Our Mission Statement</a></div>
<div><a href="#" tabindex="10">Our Staff</a>
<!-- <div><a href="#" tabindex="11">???</a></div> -->
<div><a href="./senior_pastor.html" tabindex="12">Senior Pastor</a></div>
<div><a href="./associate_pastor.html" tabindex="13">Associate Pastor</a></div>
<div><a href="./youth_minister.html" tabindex="14">Youth Minister</a></div>
<!-- <div><a href="./childrens_minister.html" tabindex="15">Children's Minister</a></div> -->
</div>
</div>
<div><a href="#" tabindex="16">Programs</a>
<div><a href="./nursery_preschool.html" tabindex="17">Nursery/Preschool</a></div>
<div><a href="#" tabindex="18">Children</a>
<div><a href="./children.html" tabindex="19">What's Going On</a></div>
<div><a href="./childrens_calendar.html" tabindex="20">Calendar</a></div>
<div><a href="./childrens_forms.html" tabindex="21">Forms</a></div>
</div>
<div><a href="#" tabindex="22">Student</a>
<div><a href="./student.html" tabindex="23">From the Youth Minister</a></div>
<div><a href="./youth_calendar.html" tabindex="24">Calendar</a></div>
<div><a href="#" tabindex="25">Bryan's Blog</a></div>
<div><a href="./youth_forms.html" tabindex="26">Forms</a></div>
</div>
</div>
<div><a href="./calendar.html" tabindex="27">Calendar</a></div>
<div><a href="./location.html" tabindex="28">Location</a></div>
<div><a href="./membership.html" tabindex="29">Membership</a></div>
<div><a href="./contact_us.html" tabindex="30">Contact Us</a></div>
<div><a href="./resources.html" tabindex="31">Resources</a></div>
</div>
</div>
</div>
</body>
</html>
Last edited by bigt0242000 on Sat Feb 16, 2008 5:55 am, edited 2 times in total.
- bigt0242000
- Posts: 19
- Joined: Thu Jun 17, 2004 12:55 am
- Location: Rome, GA
Sure. Here is what you need to do.
1. Create a file called menu.php and put what you want in that file.
You don't have to use echoing or anything like that. You also don't need to put the PHP tags in this file. Just the extension will do.
2. In your files put the following
- Code: Select all
<?php
@include('menu.php');
?>
- jbullard
- VP - Software
- Posts: 3653
- Joined: Sun Jun 06, 2004 10:17 pm
- Location: Utah
- Real Name: Jason Bullard
Both files where in the same directory. The menu file had the .php extension.
Would that javascript file have anything to do with me having trouble?
I'm still new to php, so would I have to make any other changes to the html file other than adding the code above to it.
Would that javascript file have anything to do with me having trouble?
I'm still new to php, so would I have to make any other changes to the html file other than adding the code above to it.
- bigt0242000
- Posts: 19
- Joined: Thu Jun 17, 2004 12:55 am
- Location: Rome, GA
whatever file you put the code into needs to be a .php file as well. Otherwise, the server won't process any php functions in the file. So if the homepage was originally index.html before you added that code, you'll want it to be index.php with that code in it so the server then processes the statement and includes the menu.php file.
- imnuts
- Posts: 7457
- Joined: Wed Mar 24, 2004 5:19 am
- Location: Boothwyn, Pennsylvania
- Real Name: Mark
8 posts
• Page 1 of 1
Return to HTML, CSS, and Scripts
Who is online
Users browsing this forum: No registered users and 9 guests