Re: [PHP] climb up the path

2008-06-20 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 the

Re: [PHP] climb up the path

2008-06-20 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

[PHP] climb up the path

2008-06-18 Thread Iv Ray
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); i can also explode() and reassemble all

Re: [PHP] climb up the path

2008-06-18 Thread James Dempster
Personally I use. ?php require_once(dirname(dirname(__FILE__)).'/config.php'); I think it's what most people do. /James Dempster On Wed, Jun 18, 2008 at 1:31 PM, Iv Ray [EMAIL PROTECTED] wrote: hi all, i need a way to get the path to the parent folder of the folder i am in. one dirty way

Re: [PHP] climb up the path

2008-06-18 Thread Iv Ray
James Dempster wrote: Personally I use. ?php require_once(dirname(dirname(__FILE__)).'/config.php'); 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);

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. ?php require_once(dirname(dirname(__FILE__)).'/config.php'); I think it's what most people do. A... very interesting, thanks. To get the path only I did this - $path = dirname(__FILE__); $parts

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. ?php require_once(dirname(dirname(__FILE__)).'/config.php'); I think it's what most people do. A... very interesting, thanks. To get the path only I did this - $path = dirname(__FILE__);

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 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

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

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