Re: includes linking to other files, help with relatives

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

 



Hello Allen McCabe,

it doesnt matter from which folder you call the database.php file..... only
thing u must take care is to use correct path in the database.php file so
that key.txt is accurately referenced..... if you are still having problems,
use absolute paths instead of relative path...hers a reference
http://www.ibdhost.com/help/path/.... GL...


Midhun Girish


On Mon, Dec 7, 2009 at 11:17 AM, Allen McCabe <allenmccabe@xxxxxxxxx> wrote:

> I am creating a database connection path that check for a session variable
> to get the username, password, dbname, etc., but if the session has not
> been
> set yet, I need my script to get those values from another file
> (KEY.txt) where they are saved. I want to access this class from two
> directories, and this text file (KEY.txt) is in a directory above both.
> Like
> this:
>
> root: folder1 - folder2
>
> folder1: KEY.txt
>
> folder2: index.php - database.php - folder3
>
> folder3: index.php
>
> I need to use database.php in both index files, but database.php references
> KEY.txt. So my question is, do I have to check which directory the calling
> script is in (ie. which index.php file is using database.php) and add the
> according up directory references, or do I need to use some kind of
> $_SERVER[DOCUMENT_ROOT]
> thing?
>
> Any help would be appreciated!
>

[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