1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

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

Discussion in 'Web Design & Development' started by r3drock3t88, May 13, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. r3drock3t88

    r3drock3t88 Thread Starter

    Joined:
    Jan 12, 2007
    Messages:
    272
    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!
     
  2. namenotfound

    namenotfound

    Joined:
    Apr 30, 2005
    Messages:
    3,012
    <?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.
     
  3. r3drock3t88

    r3drock3t88 Thread Starter

    Joined:
    Jan 12, 2007
    Messages:
    272
    Very awesome, thank you sir!
     
As Seen On
As Seen On...

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.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/826826