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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 Developer
http://www.onshore.com



Jochem Maas wrote:
> 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 requested URL             (http://www.example.com/foo/bar)
>
> extract the path from the URL and stick into to the document root,
> problem sorted. No?
>
> do this:
>
> var_dump($_SERVER, $_REQUEST);
>
> read the output it contains, it should have everything you
> need although you will have to do some munging.
>
> for more esoteric setups you will have to test the code
> for completeness and possible expand it's capability to
> be able to tackle those situations.
>
> take it a step at a time.
>
> me thinks I made it sound more complicated than it is for
> most scenarios ... reading your last post it seems the
> answer is (for now) quite straight forward.
>
>>
>> Thank you,
>> Micah Gersten
>> onShore Networks
>> Internal Developer
>> http://www.onshore.com
>>
>>
>>
>> Ólafur Waage wrote:
>>> 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 figure out the full local path of
>>> /foo/bar (which would be /var/www/example.com/foo/bar ) or any other
>>> directory i browse too.
>>>
>>> Ólafur Waage
>>>
>>>
>>>   
>>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux