RE: [PHP] Document root, preferred way to find it???

2005-03-08 Thread Chris W. Parker
Leif Gregory on Tuesday, March 08, 2005 6:55 AM said: > href="/includes/site.css" /> > > and I've never placed a period at the beginning. > > But you raise an interesting point. Is the server telling the browser > where the doc root is, or is the browser just gue

Re: [PHP] Document root, preferred way to find it???

2005-03-08 Thread Leif Gregory
Hello Jochem, Tuesday, March 8, 2005, 3:30:19 AM, you wrote: J> J> I'm pretty sure the url is ./includes/site.css i.e. the include J> subdir of the dir in which the html file that includes the link tag J> is in. if you move the html file up or down a dir then the link to J> the css file will bre

Re: [PHP] Document root, preferred way to find it???

2005-03-08 Thread Jochem Maas
Leif Gregory wrote: Hello Marek, Sunday, March 6, 2005, 7:08:24 PM, you wrote: I don't see where that tells me where the include folder would be. MK> If you know how the files are layed out in your application, you do. No... You missed the point of this whole thread which was explained in point 1 a

Re[2]: [PHP] SOLVED: Re: [PHP] Document root, preferred way to find it???

2005-03-07 Thread Tom Rogers
Hi, Tuesday, March 8, 2005, 12:03:54 AM, you wrote: LG> Hello Tom, LG> Sunday, March 6, 2005, 11:20:04 PM, you wrote: T>> I do this for security as I have things in include that I don't T>> want to be avaiable directly to the browser Also you don't need a T>> path for include files you can just d

Re: [PHP] SOLVED: Re: [PHP] Document root, preferred way to find it???

2005-03-07 Thread Leif Gregory
Hello Tom, Sunday, March 6, 2005, 11:20:04 PM, you wrote: T> I do this for security as I have things in include that I don't T> want to be avaiable directly to the browser Also you don't need a T> path for include files you can just do: Don't necessarily disagree with you there other than if you

Re: [PHP] SOLVED: Re: [PHP] Document root, preferred way to find it???

2005-03-06 Thread Tom Rogers
Hi, Monday, March 7, 2005, 3:57:50 PM, you wrote: LG> Hello Tom, LG> Sunday, March 6, 2005, 10:00:17 PM, you wrote: TR>> Ok I see where is is going wrong, try this: LG> Oh, very close. Although you have it at $document_root and all LG> that needs to be added is '/include' like below: LG> $i

[PHP] SOLVED: Re: [PHP] Document root, preferred way to find it???

2005-03-06 Thread Leif Gregory
Hello Tom, Sunday, March 6, 2005, 10:00:17 PM, you wrote: TR> Ok I see where is is going wrong, try this: Oh, very close. Although you have it at $document_root and all that needs to be added is '/include' like below: $include = $document_root . '/include'; Otherwise it's one directory too

Re[2]: [PHP] Document root, preferred way to find it???

2005-03-06 Thread Tom Rogers
Hi, Monday, March 7, 2005, 1:08:27 PM, you wrote: LG> Hello Tom, LG> Sunday, March 6, 2005, 6:18:54 PM, you wrote: TR>> and let me see what it prints LG> Still not quite there. LG> Site root LG> ** LG> File name: C:\Sambar\docs\test\test.php LG> Script: /test.php LG> Document root:

Re: [PHP] Document root, preferred way to find it???

2005-03-06 Thread Leif Gregory
Hello Tom, Sunday, March 6, 2005, 6:18:54 PM, you wrote: TR> and let me see what it prints Still not quite there. Site root ** File name: C:\Sambar\docs\test\test.php Script: /test.php Document root: C:\Sambar\docs\test\test.php Base: test.php Include: C:\Sambar\docs\test\include OS:

Re: [PHP] Document root, preferred way to find it???

2005-03-06 Thread Leif Gregory
Hello Marek, Sunday, March 6, 2005, 7:08:24 PM, you wrote: >> I don't see where that tells me where the include folder would be. MK> If you know how the files are layed out in your application, you do. No... You missed the point of this whole thread which was explained in point 1 and point 2 of t

Re: [PHP] Document root, preferred way to find it???

2005-03-06 Thread Marek Kilimajer
Leif Gregory wrote: I'm not sure I'm completely following you. Let's say I had the following: Site root" "c:\apache\htdocs\test" A subfolder of site root "folder1" A subfolder of the above folder1 "folder2" If I call dirname(__FILE__) from a page in each folder I'll get the following respectively:

Re[2]: [PHP] Document root, preferred way to find it???

2005-03-06 Thread Tom Rogers
Hi Leif, Monday, March 7, 2005, 10:03:48 AM, you wrote: LG> Hello Tom, LG> Friday, March 4, 2005, 9:13:41 PM, you wrote: TR>> This will set the include path just before the document root: LG> H. Not quite what I'm looking for. I set up some test folders and LG> files on a development machine

Re: [PHP] Document root, preferred way to find it???

2005-03-06 Thread Leif Gregory
Hello Marek, Sunday, March 6, 2005, 4:23:51 PM, you wrote: MK> dirname(__FILE__) MK> and then get rid of the subpath where the check is made MK> ('/include' for example) I'm not sure I'm completely following you. Let's say I had the following: Site root" "c:\apache\htdocs\test" A subfolder of

Re: [PHP] Document root, preferred way to find it???

2005-03-06 Thread Leif Gregory
Hello Tom, Friday, March 4, 2005, 9:13:41 PM, you wrote: TR> This will set the include path just before the document root: H. Not quite what I'm looking for. I set up some test folders and files on a development machine to play with your script. Here's how it was laid out: The document root

Re: [PHP] Document root, preferred way to find it???

2005-03-06 Thread Marek Kilimajer
dirname(__FILE__) and then get rid of the subpath where the check is made ('/include' for example) Leif Gregory wrote: Hello Richard, Friday, March 4, 2005, 11:41:29 AM, you wrote: R> http://php.net/set_include_path Ok... Maybe I should put all this together in one e-mail so that all the issues c

Re[3]: [PHP] Document root, preferred way to find it???

2005-03-04 Thread Tom Rogers
Hi, TR> This will set the include path just before the document root: TR> if(isset($_SERVER["SCRIPT_FILENAME"])){ TR> $root = $_SERVER['SCRIPT_FILENAME']; TR> //echo "Root: $root"; TR> $script = $_SERVER['SCRIPT_NAME']; TR> $document_root = str_replace($sc

Re[2]: [PHP] Document root, preferred way to find it???

2005-03-04 Thread Tom Rogers
Hi, Saturday, March 5, 2005, 5:47:07 AM, you wrote: LG> Hello Richard, LG> Friday, March 4, 2005, 11:41:29 AM, you wrote: R>> http://php.net/set_include_path LG> Ok... Maybe I should put all this together in one e-mail so that all LG> the issues can be looked at... LG> The problem: LG> Findin

Re: [PHP] Document root, preferred way to find it???

2005-03-04 Thread Richard Lynch
Leif Gregory wrote: > Friday, March 4, 2005, 1:25:35 PM, you wrote: > R> If *those* are broken, you might as well just not use that host. > R> :-^ > > Your solution seems to be pretty bulletproof. I definitely appreciate > it. Just wondering though for posterity sake, have you or anyone ever > run

Re: [PHP] Document root, preferred way to find it???

2005-03-04 Thread Leif Gregory
Hello Richard, Friday, March 4, 2005, 1:25:35 PM, you wrote: R> If *those* are broken, you might as well just not use that host. R> :-^ Your solution seems to be pretty bulletproof. I definitely appreciate it. Just wondering though for posterity sake, have you or anyone ever run into a host that

Re: [PHP] Document root, preferred way to find it???

2005-03-04 Thread Richard Lynch
> 6. The method (and this is the important one IMHO) would not require >editing "x" number of pages in a site to change some static path >that was set on each page. I believe you could get "x" to be 1, if you do this: 1. Set up a config_include_path.inc file in your DocumentRoot (possibly

Re: [PHP] Document root, preferred way to find it???

2005-03-04 Thread Leif Gregory
Hello Richard, Friday, March 4, 2005, 11:41:29 AM, you wrote: R> http://php.net/set_include_path Ok... Maybe I should put all this together in one e-mail so that all the issues can be looked at... The problem: Finding a reliable method to include files, keeping in mind the following: 1. The s

RE: [PHP] Document root, preferred way to find it???

2005-03-04 Thread Richard Lynch
Chris W. Parker wrote: > Leif Gregory > on Thursday, March 03, 2005 5:31 PM said: > >> Hello Richard, >> >> Thursday, March 3, 2005, 1:15:38 PM, you wrote: >>> include_path >> >> In the php.ini? But wouldn't that affect every virtual host on the >> server? Meaning

Re: [PHP] Document root, preferred way to find it???

2005-03-04 Thread Leif Gregory
Hello Chris, Friday, March 4, 2005, 9:58:05 AM, you wrote: C> .htaccess Right.. But if you're on a hosted server running Sambar which is configured to ignore .htaccess, then what? (I'm not being facetious, this is actually an issue I've run across for a client). My point I guess, is that there s

RE: [PHP] Document root, preferred way to find it???

2005-03-04 Thread Chris W. Parker
Leif Gregory on Thursday, March 03, 2005 5:31 PM said: > Hello Richard, > > Thursday, March 3, 2005, 1:15:38 PM, you wrote: >> include_path > > In the php.ini? But wouldn't that affect every virtual host on the > server? Meaning I'd have to put all the includes for

Re: [PHP] Document root, preferred way to find it???

2005-03-03 Thread Leif Gregory
Hello Richard, Thursday, March 3, 2005, 1:15:38 PM, you wrote: RL> include_path In the php.ini? But wouldn't that affect every virtual host on the server? Meaning I'd have to put all the includes for every virtual host in the same place? Cheers, Leif Gregory -- TB Lists Moderator (and fellow

Re[2]: [PHP] Document root, preferred way to find it???

2005-03-03 Thread Tom Rogers
Hi, Thursday, March 3, 2005, 11:54:48 AM, you wrote: A> If I'm reading you correctly, then a truly transportable include might look like A> this: A> $doc_root= (isset($_SERVER['path_translated'])? A> $_SERVER['path_translated'] : A> $_SERVER['document_root']; Exactly -- regard

Re: [PHP] Document root, preferred way to find it???

2005-03-03 Thread Richard Lynch
Leif Gregory wrote: > http://www.devtek.org/tutorials/dynamic_document_root.php > > I'm still looking for a better way, cause this is kludgy. include_path -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/uns

Re: [PHP] Document root, preferred way to find it???

2005-03-02 Thread Al
Tom Rogers wrote: Hi, Thursday, March 3, 2005, 5:21:58 AM, you wrote: A> I've been using in my scripts $_SERVER['DOCUMENT_ROOT'] to find the base path A> for includes, etc. A> We just moved the site to a new virtual host and it doesn't work. print_r() A> gives me: $_SERVER['document_root']= /usr/

Re: [PHP] Document root, preferred way to find it???

2005-03-02 Thread Tom Rogers
Hi, Thursday, March 3, 2005, 5:21:58 AM, you wrote: A> I've been using in my scripts $_SERVER['DOCUMENT_ROOT'] to find the base path A> for includes, etc. A> We just moved the site to a new virtual host and it doesn't work. print_r() A> gives me: >> $_SERVER['document_root']= /usr/local/apache/

Re: [PHP] Document root, preferred way to find it???

2005-03-02 Thread Leif Gregory
Hello Al, Wednesday, March 2, 2005, 12:21:58 PM, you wrote: A> What do you guys use for you docroot? I ran into the same problem and also asked here for any ideas. I finally ended up writing my own function to do it. You can find the tutorial here: http://www.devtek.org/tutorials/dynamic_docume

RE: [PHP] Document root, preferred way to find it???

2005-03-02 Thread Chris W. Parker
Al on Wednesday, March 02, 2005 11:22 AM said: > I've been using in my scripts $_SERVER['DOCUMENT_ROOT'] to find the > base path for includes, etc. > > We just moved the site to a new virtual host and it doesn't work. > print_r() gives me: > >> $_SERVER['document_

[PHP] Document root, preferred way to find it???

2005-03-02 Thread Al
I've been using in my scripts $_SERVER['DOCUMENT_ROOT'] to find the base path for includes, etc. We just moved the site to a new virtual host and it doesn't work. print_r() gives me: $_SERVER['document_root']= /usr/local/apache/htdocs $_SERVER['path_translated']= /home/user/public_html/ What d