Attention: PROnetworks has upgraded our forum from phpbb2 to phpbb3!!

Please head over to our new converted forum at: http://www.pronetworks.org/forums/

This old forum will remain 'read-only' until approximately February 2009. We look forward to seeing you at the new forum!
Author Message
bigt0242000
PostPosted: Tue Feb 12, 2008 6:09 pm Reply with quote

PRO Level 2
 
 


Joined: 16 Jun 2004
Posts: 21
Location: Rome, GA
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:
<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>
 
Back to top
jbullard
Jason Bullard
PostPosted: Tue Feb 12, 2008 7:48 pm Reply with quote

VP - Software
 
 


Joined: 06 Jun 2004
Posts: 3304
Location: Utah
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:

<?php

@include('menu.php');

?>
 
Back to top
bigt0242000
PostPosted: Wed Feb 13, 2008 2:00 pm Reply with quote

PRO Level 2
 
 


Joined: 16 Jun 2004
Posts: 21
Location: Rome, GA
I tried that and it didn't work. Anything else I could try?
 
Back to top
imnuts
PostPosted: Thu Feb 14, 2008 9:09 am Reply with quote

Support Team
 
 


Joined: 24 Mar 2004
Posts: 14585
Location: Boothwyn, Pennsylvania
make sure that when you put that into the file where the menu was, you change the extension to .php and that both files reside in the same directory.
 
Back to top
bigt0242000
PostPosted: Thu Feb 14, 2008 7:53 pm Reply with quote

PRO Level 2
 
 


Joined: 16 Jun 2004
Posts: 21
Location: Rome, GA
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.
 
Back to top
imnuts
PostPosted: Thu Feb 14, 2008 8:02 pm Reply with quote

Support Team
 
 


Joined: 24 Mar 2004
Posts: 14585
Location: Boothwyn, Pennsylvania
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.
 
Back to top
bigt0242000
PostPosted: Thu Feb 14, 2008 8:41 pm Reply with quote

PRO Level 2
 
 


Joined: 16 Jun 2004
Posts: 21
Location: Rome, GA
Thanks for the quick reply. I'll give that a try and see what happens.
 
Back to top
bigt0242000
PostPosted: Sat Feb 16, 2008 1:54 am Reply with quote

PRO Level 2
 
 


Joined: 16 Jun 2004
Posts: 21
Location: Rome, GA
Well that was my problem, I didn't change the file ext from html to php. Thanks for the help guys. notworthy
 
Back to top
Back to top
Index >> Webmaster Domain & Code Room >> Change menu from HTML to PHP [Solved]

Page 1 of 1

 


Tired of the Ads? Registered users have 80% less adverts.