I'm trying to write an include that needs to 'know' where it's being called from. In the case of nested includes, we want the original parent. For example, if the include in question is i1.php and it is included in a file called i2.php, which is in turn included by parent.php, we need to find parent.php, not i2.php.
Does $_SERVER['REQUEST_URI'] do this reliably? This is a security question; we need it to be foolproof. My understanding is that REQUEST_URI will always return the full path from the server's root directory of the file that was accessed by an end user. Is this correct? Online documentation I've found via Google is somewhat inconclusive.