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 8317219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:32:34+00:00 2026-06-08T21:32:34+00:00

I am setting up my website to use the include() statement to standardize things

  • 0

I am setting up my website to use the include() statement to standardize things like the header, footer, and navigation, e.g.

include('header.php);

However, when I use the same header file for pages in two different directories, the relative links contained within header.php break, e.g:

header.php
<a href="images/dog.jpg">

index.php
include('header.php);
becomes
<a href="images/dog.jpg">

This works because that is the correct path to dog.jpg from the index.php file.

animals/canine.php
include('header.php);
becomes
<a href="images/dog.jpg">

This DOES NOT work because animals/images/dog.jpg does not exist.

So, my question is, what can I change within the header.php file that will tailor the url to dog.jpg to work in both index.php and animals/canine.php when header.php is included?

  • 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-06-08T21:32:35+00:00Added an answer on June 8, 2026 at 9:32 pm

    Change the includes to use absolute paths:

    <a href="/images/dog.jpg">
    

    This way they’ll be based off of the root of your site and always point to the proper folder.

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

Sidebar

Related Questions

I'm currently in the process of setting my website, largely with php. Though this
On my website I use PHP sessions. Session information is stored in files in
I have a website that I am setting up that I want to use
I have a website that I am setting up with Version Control. We use
I'm setting up a website which ultimately displays videos. The video files are all
I'm interested in setting up my own website-based game (PBBG) as a hobby. Traffic
How do you go about setting up a new EPiServer website? I can't seem
Hello I did a mistake by setting UTF8 on a website that was on
I'm using PowerShell for auto-deploying website, and recently found AppPool setting which cannot be
This is a question about setting our website's Language and Culture settings with regards

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.