Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Web Design & Development Web Design & Development
Search Search
Search for:
Tech Support Guy > > >

Solved: How to change navigation using PHP? W/out having to change ALL my pages


(!)

r3drock3t88's Avatar
r3drock3t88 r3drock3t88 is offline
Computer Specs
Member with 272 posts.
THREAD STARTER
 
Join Date: Jan 2007
Experience: Advanced
13-May-2009, 12:44 PM #1
Solved: How to change navigation using PHP? W/out having to change ALL my pages
Hello all,

I am currently developing a website just for fun and out of boredom. The website will have a lot of links, and also categories. Each category will have subcategories and so on and so forth.

Now, as you can see that will include a lot of links to a lot of pages. What my question is is how would one go about developing navigation for such a thing? I know if I were to just make all these separate pages and change the links on each of them individually then it would take WAY too long and there would be much busy work and aggravation.

Could anyone please help me figure out the best way to do this? Is there a way to keep all the links in a file for example like "menu.php" and have that file be included in the proper location on my website?

Thank you all in advance!
namenotfound's Avatar
Member with 3,012 posts.
 
Join Date: Apr 2005
Location: New York
13-May-2009, 12:48 PM #2
<?php include "menu.php"; ?>

Put that in all the pages at the location where you want the menu to appear. Then when you need to add/remove a link, you just edit that one menu file.
r3drock3t88's Avatar
r3drock3t88 r3drock3t88 is offline
Computer Specs
Member with 272 posts.
THREAD STARTER
 
Join Date: Jan 2007
Experience: Advanced
13-May-2009, 12:58 PM #3
Very awesome, thank you sir!
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


Tags
category, html, menu, navigation, php

(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑