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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:23:45+00:00 2026-05-27T11:23:45+00:00

I have a site with several sub folders and an include folder in the

  • 0

I have a site with several sub folders and an include folder in the root:

for example :

www.mysite.com 
www.mysite.com/includes 
www.mysite.com/includes/inc.php

then a sub folder:

www.mysite.com/sub1/
www.mysite.com/sub1/page.php

in page.php I would like to include the inc.php which is in the includes folder.
Is that possible, and if so, how can i do that? (tried $_SERVER["DOCUMENT_ROOT"] and didn’t work.)

I appreciate the responses, it is quite urgent as I need to move the site to a new server in this format!!!! thanks everyone!

  • 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-27T11:23:46+00:00Added an answer on May 27, 2026 at 11:23 am

    I can’t think of why document root isn’t working but when you do find out, use like this…
    Have you tried echoing $_SERVER[“DOCUMENT_ROOT”] to see what it outputs?

    <?php
    
    define(ROOT, '/home/www/web18/html');
    
    require_once ROOT.'/includes/inc.php';
    
    ?>
    

    Also, run… <?php phpinfo();?>

    There should be root path somewhere…

    enter image description here

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

Sidebar

Related Questions

I have my site broken down into several folders by language: / /en/ index.php
i have on IIS 7 a site which has several sub folders. the site
On my web site I would like to have several sub-domains. Files that create
I have web-site (for example shops catalog) with several towns. If User select his
I have a site that uses for example html element id=some_id several times and
Another lame question So, I have a site that displays several students' requests to
I have a site, which contains several ashx handlers, on a couple of the
I am working on a web site with several other developers and we have
I'm new to WordPress. I have my site (CMS) divided to several pages in
I have several articles on a Joomla (1.5) site. These articles are public --

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.