Solved

$_SERVER['DOCUMENT_ROOT']

Posted on 2013-10-22
2
317 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 82

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 30

Accepted Solution

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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 …

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now