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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:28:13+00:00 2026-05-25T20:28:13+00:00

I have a site with an index.php. The index.php has a number of include

  • 0

I have a site with an index.php.
The index.php has a number of include files like

 <?php include_once('scripts/php/index_mainImageJoin.php');?>

I’ve created a new folder off the root called ‘extrapages’ and I’m going to have pages in there that have information relating to the site. I’ve added the include_once files like above and change the path and these hook up fine.

The problem I’m find is paths within the include files fail. eg: if an image or another include file is within the include it fails when run from the ‘extrapages’ folder. Pathing issue.

Is there a good way to deal with this?
Can I change/set the path to the site root (www) for pages under ‘extrapages’ to one folder down by chance?

I could move these pages onto the root and they would run fine but I really don’t want all the clutter on the root of the site.

Any ideas & thx

  • 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-25T20:28:13+00:00Added an answer on May 25, 2026 at 8:28 pm

    The key to any path problem is called absolute path

    • while creating hyperlinks for your site (including image sources), always start it from / followed by full correct path. And it never fail you.

    • same for the filesystem calls: always use absolute path. Your server usually provides you with very handy variable called $_SERVER['DOCUMENT_ROOT'] contains the point where filesystem meet web-server, pointing to your web root directory.

    So, when called from anywhere in your site,

    include $_SERVER['DOCUMENT_ROOT'].'/scripts/php/index_mainImageJoin.php';
    

    will point always to the same location

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

Sidebar

Related Questions

Information: I have a site that has a design on index.php, and then you
I have my site broken down into several folders by language: / /en/ index.php
I have already a site with a single homepage index.php which accepts 2 parameters
I have a url on my joomla site http://www.mysite.com/index.php?option=com_content&view=frontpage&Itemid=3220 My Customer wants it to
I have a website that has an index.php, a few simple .html pages and
So, I have at site where I want pages such as; www.example.com/shop/index.php (or any
I have an index.php file which has to process many different file types. How
I have sample site: /index.html /appcache.manifest /style.css /test.js index.html: <!DOCTYPE HTML> <html manifest=appcache.manifest> <head>
I got this example from the php site: <?php try { $dbh = new
I have a site and since a few days, it has a problem. My

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.