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
Solved

$_SERVER['DOCUMENT_ROOT']

Posted on 2013-10-22
2
321 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
2 Comments
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 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 250 total points
ID: 39591674
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dynamic Dropdowns 15 32
PHP Curl to output a url 7 48
Extracting store locations from Google maps or site 2 23
Log in through ID 5 17
These days socially coordinated efforts have turned into a critical requirement for enterprises.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

860 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