View Single Post
Old 03-23-2008, 06:26 PM   #1 (permalink)
solistus
The Wanderer
 
Join Date: Nov 2007
Posts: 9
Thanks: 1
solistus is on a distinguished road
Arrow $_SERVER['REQUEST_URI'] question

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.
solistus is offline  
Reply With Quote