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

  • SEARCH
  • Home
  • 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 4571902
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:34:13+00:00 2026-05-21T19:34:13+00:00

I am trying to create a common header & footer for my entire website.

  • 0

I am trying to create a common header & footer for my entire website. But my webpages are organized in different folders. How should i define my links inside the PHP file so that i can include them in all the pages.Below in a part of my menu.php file.

Code:Root
<li>
<a href="company.html" <?php echo $active[2] ?>>COMPANY</a>
<ul>
<li><a href="team.html"><strong>Our</strong> Team</a></li>
<li><a href="index.html#clienteles"><strong>Our</strong> Clientele</a></li>
<li><a href="company.html#testimonials">Testimonials</a></li>
<li><a href="others/profile.html"><strong>Our</strong> Profile</a></li>
</ul>
</li>

Code: Child
<li>
<a href="../company.html" <?php echo $active[2] ?>>COMPANY</a>
<ul>
<li><a href="../team.html"><strong>Our</strong> Team</a></li>
<li><a href="../index.html#clienteles"><strong>Our</strong> Clientele</a></li>
<li><a href="../company.html#testimonials">Testimonials</a></li>
<li><a href="../others/profile.html"><strong>Our</strong> Profile</a></li>
</ul>
</li>

I don’t want to use absolute path, because i am testing the site in a local apache server on my mac.

  • 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-21T19:34:14+00:00Added an answer on May 21, 2026 at 7:34 pm

    You should use an absolute path. Just create a BASE_URL constant for your project and point it to your base URL. After that just append it to your URLS

    <li><a href="<?php echo BASE_URL?>/team.html"><strong>Our</strong> Team</a></li>
    ...
    ...
    ...
    <li><a href="<?php echo BASE_URL?>/path/team.html"><strong>Our</strong> Team</a></li>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different
I am trying to create a website using some of the Razor functionality, but
I'm trying create a template with django but when I execute this sentences in
Trying to create a user account in a test. But getting a Object reference
I am trying to create a common service library shared between a WCF web
I'm trying to create 2 linked list with a common intersection node. As I
I'm trying to create an app that offers the user 3 different kinds of
I am trying to create a web site that best fits the most common
I'm trying to create a website in which I need to store a few
I am trying to come up with a way to create a common library

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.