Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6639053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:30:33+00:00 2026-05-25T23:30:33+00:00

sorry if this question seems a bit open ended, but I’m often wanting to

  • 0

sorry if this question seems a bit open ended, but I’m often wanting to add new pages to my website. As my website grows, this means I’m having go back and add a link to the new page on all of my previous pages, which is becoming increasingly time consuming. Is there any way around this? An automatic method? Obviously in an ideal world you’d get the template page correct first, but this doesn’t seem to allow for easy expansion. How do the big sites cope? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:30:33+00:00Added an answer on May 25, 2026 at 11:30 pm

    You user server-side includes.

    In PHP there are include() and require()

    include('filename.php') will add the contents of ‘filename.php’ to the page it was included on. Require does the same thing, but the script stops if it can’t locate or use the file.

    Instead of doing:

    <div id="navbar" >
        <ul>
            <li>Menu</li>
            <li>item</li>
            <li>item</li>
            <li>item</li>
        </ul>
    </div>
    

    Put it in a file called “navbar.html” and just do:

    <?PHP include('navbar.html'); ?>
    

    In your include file you could have:

    <div id="navbar" >
        <ul>
            <li id="1" class="<?PHP echo $m1class ?>">Menu</li>
            <li id="2" class="<?PHP echo $m2class ?>">item</li>
            <li id="3" class="<?PHP echo $m3class ?>">item</li>
            <li id="4" class="<?PHP echo $m4class ?>">item</li>
        </ul>
    </div>
    

    And then in the PHP file:

    <?PHP
        $m1class=$m2class=$m4class="notCurrent";
        $m3class="current";
        include('navbar.php');
    ?>
    

    It would be the same as doing:

    <?PHP
            $m1class=$m2class=$m4class="notCurrent";
            $m3class="current";
            include('navbar.php');
    ?>
    <div id="navbar" >
            <ul>
                <li id="1" class="<?PHP echo $m1class ?>">Menu</li>
                <li id="2" class="<?PHP echo $m2class ?>">item</li>
                <li id="3" class="<?PHP echo $m3class ?>">item</li>
                <li id="4" class="<?PHP echo $m4class ?>">item</li>
            </ul>
    </div>
    

    …except that you can change the include file so that it changes every page. The output of either would be:

    <div id="navbar">
            <ul>
                <li id="1" class="notCurrent">Menu</li>
                <li id="2" class="notCurrent">item</li>
                <li id="3" class="current">item</li>
                <li id="4" class="notCurrent">item</li>
            </ul>
    </div>
    

    Goodluck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this question seems obvious for everyone, but I am very new to
Sorry if this question seems trivial to many here. In a C++ code there
Sorry if my question seems dumb. I've started using Eclipse Ganymede 3.4 this week
Ok sorry this might seem like a dumb question but I cannot figure this
Sorry if this question is too vague, but I'd rather not muddy it's point
Sorry if this question is very easy, but I can't find the answer anywhere.
sorry for this question, but i dont know where to search for it, or
Sorry if this question is somewhat subjective. I am new to 'could store', 'distributed
Sorry if this question is answered already, but I didn't find a suitable answer.
OK sorry this is a bit of a stupid question. Currently I am developing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.