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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:52:21+00:00 2026-05-28T00:52:21+00:00

I wrote a website in HTML but then I wanted the header and navbar

  • 0

I wrote a website in HTML but then I wanted the header and navbar portion in one file so I just had to change it once. I changed all the pages to .php and added the php includes. However now I get an error on pages that I’ve put in folders so I could create cruftless links.

Header file: /test/assets/header.php

Works: /test/index.php contains <?php include 'assets/header.php'; ?>

Throws Error: /test/company/index.php contains <?php include '/test/assets/header.php'; ?>

Error:

Warning: include(/test/assets/header.php) [function.include]: failed to open stream: No such file or directory

Warning: include() [function.include]: Failed opening '/test/assets/header.php' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear')

I am having an issue linking to the header file that is in a folder in the root folder. I believe it is a simple issue of just not knowing how to input the URL. If I attempt to include the full path to the header.php I get a URL file-access is disabled error

  • 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-28T00:52:21+00:00Added an answer on May 28, 2026 at 12:52 am

    If you start a path with a / then it’s an absolute path. Absolute mains to the actual filesystem root directory, not the virtual document root. This is why it fails.

    Commonly this is what was meant:

    include "$_SERVER[DOCUMENT_ROOT]/test/assets/header.php";
    // Note: array key quotes only absent in double quotes context
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a website that publishes scientific articles, not as PDF but as HTML.
I wrote an autocompletion script for an input field on a website. It uses
I'm using Django Paginator everywhere on my website and even wrote a special template
I am creating a simple(ish) website for one of my iPhone apps using the
If a website user submits an HTML form with: (1) a post method; (2)
I'm trying to load a javascript file into a PHP page and then i
I have an ASP.NET website and from one of the web pages I need
I've just started learning Python and I'm slowly getting the hang of it, but
I'm developing a website where user's can create calendars and then add events to
In the admin section of my website's glossary, I wrote an ajax function which

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.