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 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
> http://www.onshore.com
>
>
>
> Ólafur Waage wrote:
>> 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 came from.
>>
>> Ólafur Waage.
>>
>> 2008/8/22 Micah Gersten <[EMAIL PROTECTED]>:
>>
>>> 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 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 (for example via
>>>> DirectoryIndex of Apache)
>>>>
>>>> Then i make a new directory: /var/www/test/
>>>> And browse to it and it echo's /var/www/example/ since its running
>>>> that file via DirectoryIndex
>>>>
>>>> This is true for all directories i make. Both for Windows and Linux
>>>> based servers.
>>>>
>>>> To my question.
>>>>
>>>> I am trying to get the full path of the current directory i am in. Not
>>>> from where the file is executing. How is that possible so it displays
>>>> a full path to that directory (regardless to the server setup)?
>>>>
>>>> I have tried a variation of things and have gotten mixed results.
>>>> Using $_SERVER["SCRIPT_FILENAME"] gives me the index file and the full
>>>> path to that.
>>>> $_SERVER["DOCUMENT_ROOT"] gets me part of the way but on a hosted
>>>> server with multiple domains it only gives me a partial path (rough
>>>> example: /var/www/ when the directory is /var/www/domain.com/test/)
>>>> And __FILE__ gives me the index.php's path.
>>>> I have also tried realpath(".");
>>>> And server("pwd"); with no luck.
>>>>
>>>> Any help would be appreciated.
>>>>
>>>> Ólafur Waage
>>>>
>>>>
>>>>
>>
>>
>

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

Reply via email to