useing __FILE__ and locating root folder in php ? how do i do this?

Osiris2k

New Member
lets say we have a directory.project/index.phpin index.php\[code\]<?phprequire 'config/config.php';echo ROOTPATH;?>\[/code\]project/config/config.php\[code\]<?phpdefine('ROOTPATH', rtrim(dirname(__FILE__), '\\/'));?>\[/code\]it will return likeD:\Project Storage\Web Projects\www\project\config.question:[*]is there an easy way to get the rootpath without puting it on the project folder ? ( i know this is supid but i cant stand to ask )[*]is there a way to get the \project\ ( root folder ) ? even if we change the folder location ?ThanksAdam Ramadhanps*please leave a comment if you dont understand what i mean.
 
Back
Top