Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-26 Thread Micah Gersten
I said AFAIK. I was under the impression the DirectoryIndex did a redirect. I just tested it and it does not, so you are correct Jochem. He has everything he needs. He'll need the document root and $_SERVER['REQUEST_URI'] to do this. Thank you, Micah Gersten onShore Networks Internal

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-24 Thread Ólafur Waage
I am pretty certain that this isnt possible under current code. But i just wanted a confirmation on this, since i worked on the code for a while trying to get to the end point. And yes Jochem, i am looking for a magical location :P Well, thanks guys :) Ólafur Waage 2008/8/24 Micah Gersten

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-24 Thread Jochem Maas
Micah Gersten schreef: What is the point of figuring that out? If we knew that, we might be able to help you with a solution. As it stands what you want is not possible AFAIK. you know wrong. he has all the info needed. 1. the document root of the site (/var/www/example.com) 2. the

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-23 Thread Ólafur Waage
Robert, thanks for the reply but i had tried __FILE__ and __DIR__ (which is dirname(__FILE__)) but it doesnt work. And thanks for the reply also Ashley but as i said in my first post, i had tried $_SERVER with limited results Ólafur Waage 2008/8/23 Robert Cummings [EMAIL PROTECTED]: On Fri,

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-23 Thread Ólafur Waage
Luke, i am looking for local directory info. Not URL info as i said before. And Ashley, as i said in the original mail. I had tried $_SERVER. Thanks for the reply though. Ólafur Waage 2008/8/23 Luke [EMAIL PROTECTED]: $_REQUEST? Luke Slater Lead Developer NuVoo On 23 Aug 2008, at 12:53,

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-23 Thread David Otton
2008/8/23 Ólafur Waage [EMAIL PROTECTED]: Robert, thanks for the reply but i had tried __FILE__ and __DIR__ (which is dirname(__FILE__)) but it doesnt work. And thanks for the reply also Ashley but as i said in my first post, i had tried $_SERVER with limited results If checking the output

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-23 Thread Ólafur Waage
Thanks for this David, i was using REQUEST_URI and other $_SERVER info and mixed that together. It worked in some situations but on hosted servers (like GoDaddy and others like that where they use a complicated directory setup) it does not work. Olafur Waage 2008/8/23 David Otton [EMAIL

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-23 Thread Jochem Maas
Ólafur Waage schreef: Robert, thanks for the reply but i had tried __FILE__ and __DIR__ (which is dirname(__FILE__)) but it doesnt work. __DIR__ only came into existence very recently IIRC, realpath(dirname(__FILE__)); will tell you what directory the *current script* is actually living in

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-23 Thread Micah Gersten
What is the point of figuring that out? If we knew that, we might be able to help you with a solution. As it stands what you want is not possible AFAIK. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: I am within a certain directory

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-22 Thread Ashley Sheridan
How are you browsing to it from within PHP? Depending on how you are doing it, the way to get the cwd is different Ash www.ashleysheridan.co.uk ---BeginMessage--- I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-22 Thread Ólafur Waage
Thanks for the reply Micah but i have no interest in the URL. I am looking for the servers local path to the directory. (example: /var/www/directory/ or C:\apache\htdocs\directory\) Also the HTTP_REFERER is empty unless you are linked in from another location. And then it gives you the URL you

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-22 Thread Micah Gersten
You might want to try a Redirect Rule or rewrite which would tell you the HTTP PATH. AFAIK, there is no way to know which directory they tried to access unless you write your own index.php and store it in a session variable. Thank you, Micah Gersten onShore Networks Internal Developer

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-22 Thread Ólafur Waage
That is the brick wall i faced. There is no way to know where exactly you are (via DirectoryIndex) locally on the machine. Thanks though. 2008/8/22 Micah Gersten [EMAIL PROTECTED]: You might want to try a Redirect Rule or rewrite which would tell you the HTTP PATH. AFAIK, there is no way to

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-22 Thread Ashley Sheridan
On Fri, 2008-08-22 at 21:56 +, Ólafur Waage wrote: That is the brick wall i faced. There is no way to know where exactly you are (via DirectoryIndex) locally on the machine. Thanks though. 2008/8/22 Micah Gersten [EMAIL PROTECTED]: You might want to try a Redirect Rule or rewrite

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-22 Thread Ólafur Waage
I am within a certain directory of the server via the browser. Example: http://www.example.com/foo/bar would be /var/www/example.com/foo/bar And Apache's DirectoryIndex feature is opening a index.php file that is located at /var/www/example.com/test/index.php And from that file i need to

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-22 Thread Eric Butera
On Thu, Aug 21, 2008 at 8:50 PM, Ólafur Waage [EMAIL PROTECTED] wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-22 Thread Robert Cummings
On Fri, 2008-08-22 at 22:13 -0400, Eric Butera wrote: On Thu, Aug 21, 2008 at 8:50 PM, Ólafur Waage [EMAIL PROTECTED] wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns:

[PHP] Quick question regarding getcwd() and directory location.

2008-08-21 Thread Ólafur Waage
I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-21 Thread Micah Gersten
Once you tell apache to load /example/index.php, that's where you are. You might try looking at the $_SERVER['HTTP_REFERER']. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: I'll throw out an example here. I have a directory structure