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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:56:47+00:00 2026-05-22T16:56:47+00:00

Basically, I have a class Avian that contains logic for some basic things such

  • 0

Basically, I have a class Avian that contains logic for some basic things such as:

  1. Connecting to MySQL
  2. Checking login status
  3. Displaying the navigation bar

These files are stored in “projectavian” which is a folder within my host’s root directory and is the folder for all files that will display on mydomain.com.

I’ve gone and set up a few subdomains such as dev.mydomain.com. My host creates folders for subdomains in the root directory alongside the “projectavian” folder. The furthest back that I seem to be able to go from within a HTML/PHP page in “projectavian” or the folder for my subdomain is up to this folder only (ie I can’t actually access the root by going "/subdomain_folder" or adding as many "../"s as I want.

All I need to do is use include or require to get my PHP class from mydomain.com on a page that’s at dev.mydomain.com. Obviously you can’t do include "http://somedomain.com/file.php". Is there maybe a PHP function that can access the server root directory?

  • 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-22T16:56:48+00:00Added an answer on May 22, 2026 at 4:56 pm

    You can use magic constants combined with dirname like this:

    $root = dirname(dirname(__FILE__));
    

    which lets you access your root directory and from there you can do something like:

    $path = $root . '/subdomain_folder/' . $filename;
    

    check out these references for both dirname and the magic constant

    http://php.net/manual/en/function.dirname.php

    http://php.net/manual/en/language.constants.predefined.php

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

Sidebar

Related Questions

Basically I have some class objects, each with three properties. Once one class object
I have a class that basically stores files in amazon s3. Here is what
I'm testing a C++ class with a number of functions that all have basically
what I mean by that is: I basically have a class that has too
I have a class that extends TabControl, basically to have one with the tabs
Having some trouble passing values from one class to another. I basically have a
Basically I have a PHP class that that I want to test from the
My program is seemingly having a deadlock problem. Basically I have a class that
Basically I have a class that sends a SOAP request for room information receives
Basically I have the following class: class StateMachine { ... StateMethod stateA(); StateMethod stateB();

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.