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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:42:34+00:00 2026-06-11T01:42:34+00:00

Okay so on my website I have a scripts folder which includes a php

  • 0

Okay so on my website I have a scripts folder which includes a php file which connects to mysql server so If I move a database then It will change it on all the files which are connect to the database.

I also have another folder called templates. In that folder there is a top for the header and the footer. In the header template I wrote:

require("../scripts/connect.php");

And I have another folder called, category. And that folder includes the header and the header includes connect. But then it displays and error that there is no such files.

Please help. Thank you

  • 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-06-11T01:42:35+00:00Added an answer on June 11, 2026 at 1:42 am

    A good practice is to include a main config in all running php files, usually called config.php 🙂

    in this config file create a constant called SITE_ROOT or something similar that point to the exact folder like this
    define("SITE_ROOT", "/var/www/mysite");

    Then on any include, include_once, require, require_once use it like this:

    require(SITE_ROOT."/scripts/connect.php");
    

    This should solve any relative path drama

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

Sidebar

Related Questions

Okay, at the moment i have my domain's host file which was generated by
Okay, so I have a website where the user can put a search query
Okay this question is very simple: I have a facebook page, and a website.
Okay, so here's my problem: I have a list of members on a website,
Okay so I have a problem with a website I am working on.. infact
Okay I have been working on a website but I keep on having an
Is it okay to have a full silverlight website? I've seen some website implements
Okay, so basicly I have this website that auto refreshes every couple of seconds,
Okay so I have a form that is using PHP to mail to an
We have developed a website, which was wroking fine until some days back, but

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.