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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:13:17+00:00 2026-05-14T23:13:17+00:00

I not sure what’s going on..maybe I missed something simple. In my connectvars.php file,

  • 0

I not sure what’s going on..maybe I missed something simple.

In my connectvars.php file, I connect to the database using the variables in my config.php folder.
Here’s the hierarchy:

admin(folder)
   config.php
includes(folder)
   connectvars.php
index.php

I want to get information from config.php to use in connectvars.php, so I use:
require_once(“../admin/config.php”);
But everytime I do this I get Warning: require_once(../admin/config.php) [function.require-once]: failed to open stream: No such file or directory in /home/a8879415/public_html/includes/connectvars.php on line 2

BUT when I type: require_once("admin/config.php");, it works.

I thought I had to go up a level, then go down to admin, then get config.php. So how come I just need to go into the admin folder then get config.php?

  • 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-14T23:13:18+00:00Added an answer on May 14, 2026 at 11:13 pm

    Are you running includes/connectvars.php directly or is it included by other file?

    I think you are running index.php and every files are included relatively to it’s path.

    If you want to use relative path to other files, it can be done like that:

    require_once( dirname(__FILE__) . '/../admin/config.php' );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure if I've just missed something but this doesn't work: $(this).children('td.threadtitle a').html('thread title');
Not sure what's going on here, but in my Rails 3 application, I type
Not sure if this is possible, but here goes. I have a MongoDB (using
Not sure what is going on. When I perform the following code... it runs
Not sure how to fix this problem - I am using jQuery to show
Not sure what exactly is going on here, but seems like in .NET 1.1
Not sure what's going on here. I have a DateTime object, and when I
not sure if this is possible keeping the code simple, but im trying to
Not sure if this counts as programming related, it's a tool that I use.
Not sure exactly what I need to do to make this work, so 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.