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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:10:15+00:00 2026-05-26T18:10:15+00:00

What the different between ./ vs ../ vs / I’m very confused, i tried

  • 0

What the different between ./ vs ../ vs /

I’m very confused, i tried to access PHP class in different level folder.

I have the following folder structure in webdir/asia/v1:

+db
  class.database.php
  config.database.php
  +model
    Application.php
text.php

In class.database.php, I want include config.database.php which is in the same folder.

In Application.php, I want include class.database.php which is in the level above.

In text.php, I want include Application.php.

How do I include correctly?

What I know for now is that to include files in the same folder, I can use this:

include('config.database.php');

What about the other two variations? I tried in Application.php to include class.database.php like this :

include_once('../class.database.php');

but it doesn’t work.

  • 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-26T18:10:16+00:00Added an answer on May 26, 2026 at 6:10 pm

    use
    include(dirname(dirname(__FILE__)) . “/class.database.php”);
    and see if it works.

    Edit:
    Here,dirname(__FILE__) gives you the current directory where dirname of “dirname(__FILE__)” takes you one step up in hierarachy of directory tree.

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

Sidebar

Related Questions

I don't understand what is structurally different between a Value Object and a Class
Possible Duplicate: what does $$ mean in PHP? what is the different between $thisvariable
Can someone explain what the different between these two instantiations of the ArrayList class?
I am using windows form and mysql. I am very confuse about different between
Loading process image file different between VS 2005 and VS 2010 We have a
I'm confused about what the different between axes and axis is in matplotlib. Could
Is there any performance different between hosting your asp.net in mono on linux and
What is the different between clearfix hack and overflow:hidden vs overflow:auto ? Are all
What's the different between var myObject : Sprite = new Sprite(); and var myObject
Can someone tell me the different between LinkButton.PostBackUrl and HyperLink.NavigateUrl? I've got a asp.net

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.