?
Solved

$_SERVER['DOCUMENT_ROOT']

Posted on 2013-10-22
2
Medium Priority
?
332 Views
Last Modified: 2013-10-22
I am using $_SERVER['DOCUMENT_ROOT'] to determine the location on the server of "where I am". We have a "live" version of the system & a "test" version; the test version is in a folder called test. So, for example, www.xyz.com is live & www.xyz.com/test is test.

When I use $_SERVER['DOCUMENT_ROOT'], I get the path to the live system, even if I am executing in /test.

Why?
0
Comment
Question by:Richard Korts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1000 total points
ID: 39591617
Because the 'root' of your web site on the server is the same no matter what subdirectory you are in.
0
 
LVL 31

Accepted Solution

by:
Marco Gasi earned 1000 total points
ID: 39591674
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question