Re: [PHP] climb up the path

2008-06-19 Thread Iv Ray
Richard Heyes wrote: i need a way to get the path to the parent folder of the folder i am in. one "dirty" way i found is this - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "config.php"); i can also explode() and rea

Re: [PHP] climb up the path

2008-06-19 Thread Iv Ray
Jim Lucas wrote: > Iv Ray wrote: >> Jim Lucas wrote: > So, saying that it is outside the source does not tell me if it is > outside the document root. A, right. It is outside the document root. > Use your include_path php_ini setting A, right... Didn't think of it. Actually, I do not like th

Re: [PHP] climb up the path

2008-06-18 Thread Richard Heyes
i need a way to get the path to the parent folder of the folder i am in. one "dirty" way i found is this - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "config.php"); i can also explode() and reassemble all folders

Re: [PHP] climb up the path

2008-06-18 Thread Jim Lucas
Iv Ray wrote: Jim Lucas wrote: Iv, tell me why you are wanting to do this? If it is the reason I think it is, I can give you a better way to accomplish this. I have the source and a configuration file, which I want outside the source - it is different from server to server. The easiest i

Re: [PHP] climb up the path

2008-06-18 Thread Iv Ray
Jim Lucas wrote: Iv, tell me why you are wanting to do this? If it is the reason I think it is, I can give you a better way to accomplish this. I have the source and a configuration file, which I want outside the source - it is different from server to server. The easiest is to have the c

Re: [PHP] climb up the path

2008-06-18 Thread Iv Ray
Stut wrote: $path = dirname(dirname(__FILE__)); That will get you the parent directory. -Stut A,... right! - me and my limited thinking... - dirname() gives the parent of a file AND of a directory, right. Thanks, Iv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] climb up the path

2008-06-18 Thread Jim Lucas
Stut wrote: On 18 Jun 2008, at 13:57, Iv Ray wrote: James Dempster wrote: > Personally I use. > > > I think it's what most people do. A... very interesting, thanks. To get the path only I did this - $path = dirname(__FILE__); $parts= explode(DIRECTORY_SEPARATOR, $path); arra

Re: [PHP] climb up the path

2008-06-18 Thread Stut
On 18 Jun 2008, at 13:57, Iv Ray wrote: James Dempster wrote: > Personally I use. > > > I think it's what most people do. A... very interesting, thanks. To get the path only I did this - $path = dirname(__FILE__); $parts= explode(DIRECTORY_SEPARATOR, $path); array_pop($parts)

Re: [PHP] climb up the path

2008-06-18 Thread Iv Ray
James Dempster wrote: > Personally I use. > > > I think it's what most people do. A... very interesting, thanks. To get the path only I did this - $path = dirname(__FILE__); $parts= explode(DIRECTORY_SEPARATOR, $path); array_pop($parts); $INSTALL_PATH = implode(DIRECTORY_SEPA

Re: [PHP] climb up the path

2008-06-18 Thread James Dempster
Personally I use. wrote: > hi all, > > i need a way to get the path to the parent folder of the folder i am in. > one "dirty" way i found is this - > > require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . > ".." . DIRECTORY_SEPARATOR . > "config.php"); > >