Re: Path question
| From: | Al | Date: | Tue, 29 Mar 2011 17:06:05 +0000 |
| Subject: | Re: Path question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-312122@lists.php.net to get a copy of this message | ||
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! JackHere'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