Re: Path question

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

 





On 3/28/2011 9:18 PM, Jack wrote:
Hello All,



Is there a smarter way to do includes by setting up a path or something
where I don't have to include /home/domain.com/includes/include_file.php

Apparently my path is as shown above,  but I would prefer to just put in
/includes/include_file.php





Thanks!

Jack





Here's how I do it. For every application, I have a config file with all my
common assignments, including common paths, e.g.,

define('EDITPAGE_ROOT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/editPageSR/');
define('EDITPAGE_IMAGES_DIR', EDITPAGE_ROOT_DIR . 'images/');
define('EDITPAGE_DATA_DIR', PAGE_ROOT_DIR . '/editPageFiles/');

So, in your case, I'd have

define('INCLUDE_FILE', $_SERVER['DOCUMENT_ROOT'] . "/includes /include_file.php");

So all I need is to use INCLUDE_FILE

--
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